Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1270603 > unrolled thread

[PATCH 0/3] ste_dma40: Deletion of a few unnecessary checks

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2015-11-16 22:30 +0100
Last post2015-11-29 22:30 +0100
Articles 5 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 0/3] ste_dma40: Deletion of a few unnecessary checks SF Markus Elfring <elfring@users.sourceforge.net> - 2015-11-16 22:30 +0100
    [PATCH 3/3] ste_dma40: Delete an unnecessary variable initialisation  in d40_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-11-16 22:30 +0100
      Re: [PATCH 3/3] ste_dma40: Delete an unnecessary variable  initialisation in d40_probe() Linus Walleij <linus.walleij@linaro.org> - 2015-11-29 22:30 +0100
    [PATCH 1/3] ste_dma40: Delete an unnecessary check before the  function call "kmem_cache_destroy" SF Markus Elfring <elfring@users.sourceforge.net> - 2015-11-16 22:30 +0100
      Re: [PATCH 1/3] ste_dma40: Delete an unnecessary check before the  function call "kmem_cache_destroy" Linus Walleij <linus.walleij@linaro.org> - 2015-11-29 22:30 +0100

#1270603 — [PATCH 0/3] ste_dma40: Deletion of a few unnecessary checks

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2015-11-16 22:30 +0100
Subject[PATCH 0/3] ste_dma40: Deletion of a few unnecessary checks
Message-ID<qvzvz-4cE-5@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 16 Nov 2015 22:12:23 +0100

Further update suggestions were taken into account after a patch
was applied from static source code analysis.

Markus Elfring (3):
  Delete an unnecessary check before the function call "kmem_cache_destroy"
  Delete another unnecessary check in d40_probe()
  Delete an unnecessary variable initialisation in d40_probe()

 drivers/dma/ste_dma40.c | 87 ++++++++++++++++++++++++-------------------------
 1 file changed, 42 insertions(+), 45 deletions(-)

-- 
2.6.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1270606 — [PATCH 3/3] ste_dma40: Delete an unnecessary variable initialisation in d40_probe()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2015-11-16 22:30 +0100
Subject[PATCH 3/3] ste_dma40: Delete an unnecessary variable initialisation in d40_probe()
Message-ID<qvzvB-4cE-53@gated-at.bofh.it>
In reply to#1270603
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 16 Nov 2015 22:00:28 +0100

The variable "res" will eventually be set to a resource pointer from
a call of the d40_hw_detect_init(() function.
Thus let us omit the explicit initialisation at the beginning.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/dma/ste_dma40.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 8ebfde1..6fb8307 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -3544,7 +3544,7 @@ static int __init d40_probe(struct platform_device *pdev)
 	struct device_node *np = pdev->dev.of_node;
 	int ret = -ENOENT;
 	struct d40_base *base;
-	struct resource *res = NULL;
+	struct resource *res;
 	int num_reserved_chans;
 	u32 val;
 
-- 
2.6.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1279423 — Re: [PATCH 3/3] ste_dma40: Delete an unnecessary variable initialisation in d40_probe()

FromLinus Walleij <linus.walleij@linaro.org>
Date2015-11-29 22:30 +0100
SubjectRe: [PATCH 3/3] ste_dma40: Delete an unnecessary variable initialisation in d40_probe()
Message-ID<qAhHI-2TW-23@gated-at.bofh.it>
In reply to#1270606
On Mon, Nov 16, 2015 at 10:26 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:

> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 16 Nov 2015 22:00:28 +0100
>
> The variable "res" will eventually be set to a resource pointer from
> a call of the d40_hw_detect_init(() function.
> Thus let us omit the explicit initialisation at the beginning.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1270611 — [PATCH 1/3] ste_dma40: Delete an unnecessary check before the function call "kmem_cache_destroy"

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2015-11-16 22:30 +0100
Subject[PATCH 1/3] ste_dma40: Delete an unnecessary check before the function call "kmem_cache_destroy"
Message-ID<qvzvC-4cE-65@gated-at.bofh.it>
In reply to#1270603
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 16 Nov 2015 20:26:27 +0100

The kmem_cache_destroy() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/dma/ste_dma40.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index dd3e7ba..9132ae0 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -3694,8 +3694,7 @@ static int __init d40_probe(struct platform_device *pdev)
 
 failure:
 	if (base) {
-		if (base->desc_slab)
-			kmem_cache_destroy(base->desc_slab);
+		kmem_cache_destroy(base->desc_slab);
 		if (base->virtbase)
 			iounmap(base->virtbase);
 
-- 
2.6.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1279422 — Re: [PATCH 1/3] ste_dma40: Delete an unnecessary check before the function call "kmem_cache_destroy"

FromLinus Walleij <linus.walleij@linaro.org>
Date2015-11-29 22:30 +0100
SubjectRe: [PATCH 1/3] ste_dma40: Delete an unnecessary check before the function call "kmem_cache_destroy"
Message-ID<qAhHI-2TW-21@gated-at.bofh.it>
In reply to#1270611
On Mon, Nov 16, 2015 at 10:23 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:

> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 16 Nov 2015 20:26:27 +0100
>
> The kmem_cache_destroy() function tests whether its argument is NULL
> and then returns immediately. Thus the test around the call is not needed.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web