All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] GPIO-Timberdale: Adjustments for timbgpio_probe()
@ 2018-02-10 20:31 ` SF Markus Elfring
  0 siblings, 0 replies; 10+ messages in thread
From: SF Markus Elfring @ 2018-02-10 20:31 UTC (permalink / raw)
  To: linux-gpio, Linus Walleij; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 10 Feb 2018 21:28:29 +0100

Two update suggestions were taken into account
from static source code analysis.

Markus Elfring (2):
  Delete an error message for a failed memory allocation
  Improve a size determination

 drivers/gpio/gpio-timberdale.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

-- 
2.16.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 0/2] GPIO-Timberdale: Adjustments for timbgpio_probe()
@ 2018-02-10 20:31 ` SF Markus Elfring
  0 siblings, 0 replies; 10+ messages in thread
From: SF Markus Elfring @ 2018-02-10 20:31 UTC (permalink / raw)
  To: linux-gpio, Linus Walleij; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 10 Feb 2018 21:28:29 +0100

Two update suggestions were taken into account
from static source code analysis.

Markus Elfring (2):
  Delete an error message for a failed memory allocation
  Improve a size determination

 drivers/gpio/gpio-timberdale.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

-- 
2.16.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/2] gpio: timberdale: Delete an error message for a failed memory allocation in timbgpio_probe()
  2018-02-10 20:31 ` SF Markus Elfring
@ 2018-02-10 20:32   ` SF Markus Elfring
  -1 siblings, 0 replies; 10+ messages in thread
From: SF Markus Elfring @ 2018-02-10 20:32 UTC (permalink / raw)
  To: linux-gpio, Linus Walleij; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 10 Feb 2018 21:09:08 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

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

diff --git a/drivers/gpio/gpio-timberdale.c b/drivers/gpio/gpio-timberdale.c
index 181f86ce00cd..ff155e437210 100644
--- a/drivers/gpio/gpio-timberdale.c
+++ b/drivers/gpio/gpio-timberdale.c
@@ -239,10 +239,9 @@ static int timbgpio_probe(struct platform_device *pdev)
 	}
 
 	tgpio = devm_kzalloc(dev, sizeof(struct timbgpio), GFP_KERNEL);
-	if (!tgpio) {
-		dev_err(dev, "Memory alloc failed\n");
+	if (!tgpio)
 		return -EINVAL;
-	}
+
 	tgpio->irq_base = pdata->irq_base;
 
 	spin_lock_init(&tgpio->lock);
-- 
2.16.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 1/2] gpio: timberdale: Delete an error message for a failed memory allocation in timbgpio_pro
@ 2018-02-10 20:32   ` SF Markus Elfring
  0 siblings, 0 replies; 10+ messages in thread
From: SF Markus Elfring @ 2018-02-10 20:32 UTC (permalink / raw)
  To: linux-gpio, Linus Walleij; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 10 Feb 2018 21:09:08 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

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

diff --git a/drivers/gpio/gpio-timberdale.c b/drivers/gpio/gpio-timberdale.c
index 181f86ce00cd..ff155e437210 100644
--- a/drivers/gpio/gpio-timberdale.c
+++ b/drivers/gpio/gpio-timberdale.c
@@ -239,10 +239,9 @@ static int timbgpio_probe(struct platform_device *pdev)
 	}
 
 	tgpio = devm_kzalloc(dev, sizeof(struct timbgpio), GFP_KERNEL);
-	if (!tgpio) {
-		dev_err(dev, "Memory alloc failed\n");
+	if (!tgpio)
 		return -EINVAL;
-	}
+
 	tgpio->irq_base = pdata->irq_base;
 
 	spin_lock_init(&tgpio->lock);
-- 
2.16.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/2] gpio: timberdale: Improve a size determination in timbgpio_probe()
  2018-02-10 20:31 ` SF Markus Elfring
@ 2018-02-10 20:33   ` SF Markus Elfring
  -1 siblings, 0 replies; 10+ messages in thread
From: SF Markus Elfring @ 2018-02-10 20:33 UTC (permalink / raw)
  To: linux-gpio, Linus Walleij; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 10 Feb 2018 21:13:28 +0100

Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

This issue was detected by using the Coccinelle software.

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

diff --git a/drivers/gpio/gpio-timberdale.c b/drivers/gpio/gpio-timberdale.c
index ff155e437210..6520a8475910 100644
--- a/drivers/gpio/gpio-timberdale.c
+++ b/drivers/gpio/gpio-timberdale.c
@@ -238,7 +238,7 @@ static int timbgpio_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	tgpio = devm_kzalloc(dev, sizeof(struct timbgpio), GFP_KERNEL);
+	tgpio = devm_kzalloc(dev, sizeof(*tgpio), GFP_KERNEL);
 	if (!tgpio)
 		return -EINVAL;
 
-- 
2.16.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/2] gpio: timberdale: Improve a size determination in timbgpio_probe()
@ 2018-02-10 20:33   ` SF Markus Elfring
  0 siblings, 0 replies; 10+ messages in thread
From: SF Markus Elfring @ 2018-02-10 20:33 UTC (permalink / raw)
  To: linux-gpio, Linus Walleij; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 10 Feb 2018 21:13:28 +0100

Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

This issue was detected by using the Coccinelle software.

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

diff --git a/drivers/gpio/gpio-timberdale.c b/drivers/gpio/gpio-timberdale.c
index ff155e437210..6520a8475910 100644
--- a/drivers/gpio/gpio-timberdale.c
+++ b/drivers/gpio/gpio-timberdale.c
@@ -238,7 +238,7 @@ static int timbgpio_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	tgpio = devm_kzalloc(dev, sizeof(struct timbgpio), GFP_KERNEL);
+	tgpio = devm_kzalloc(dev, sizeof(*tgpio), GFP_KERNEL);
 	if (!tgpio)
 		return -EINVAL;
 
-- 
2.16.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] gpio: timberdale: Delete an error message for a failed memory allocation in timbgpio_probe()
  2018-02-10 20:32   ` [PATCH 1/2] gpio: timberdale: Delete an error message for a failed memory allocation in timbgpio_pro SF Markus Elfring
@ 2018-02-22 14:14     ` Linus Walleij
  -1 siblings, 0 replies; 10+ messages in thread
From: Linus Walleij @ 2018-02-22 14:14 UTC (permalink / raw)
  To: SF Markus Elfring; +Cc: linux-gpio, LKML, kernel-janitors

On Sat, Feb 10, 2018 at 9:32 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:

> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 10 Feb 2018 21:09:08 +0100
>
> Omit an extra message for a memory allocation failure in this function.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] gpio: timberdale: Delete an error message for a failed memory allocation in timbgpio
@ 2018-02-22 14:14     ` Linus Walleij
  0 siblings, 0 replies; 10+ messages in thread
From: Linus Walleij @ 2018-02-22 14:14 UTC (permalink / raw)
  To: SF Markus Elfring; +Cc: linux-gpio, LKML, kernel-janitors

On Sat, Feb 10, 2018 at 9:32 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:

> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 10 Feb 2018 21:09:08 +0100
>
> Omit an extra message for a memory allocation failure in this function.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] gpio: timberdale: Improve a size determination in timbgpio_probe()
  2018-02-10 20:33   ` SF Markus Elfring
@ 2018-02-22 14:15     ` Linus Walleij
  -1 siblings, 0 replies; 10+ messages in thread
From: Linus Walleij @ 2018-02-22 14:15 UTC (permalink / raw)
  To: SF Markus Elfring; +Cc: linux-gpio, LKML, kernel-janitors

On Sat, Feb 10, 2018 at 9:33 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:

> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 10 Feb 2018 21:13:28 +0100
>
> Replace the specification of a data structure by a pointer dereference
> as the parameter for the operator "sizeof" to make the corresponding size
> determination a bit safer according to the Linux coding style convention.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] gpio: timberdale: Improve a size determination in timbgpio_probe()
@ 2018-02-22 14:15     ` Linus Walleij
  0 siblings, 0 replies; 10+ messages in thread
From: Linus Walleij @ 2018-02-22 14:15 UTC (permalink / raw)
  To: SF Markus Elfring; +Cc: linux-gpio, LKML, kernel-janitors

On Sat, Feb 10, 2018 at 9:33 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:

> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 10 Feb 2018 21:13:28 +0100
>
> Replace the specification of a data structure by a pointer dereference
> as the parameter for the operator "sizeof" to make the corresponding size
> determination a bit safer according to the Linux coding style convention.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-02-22 14:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-10 20:31 [PATCH 0/2] GPIO-Timberdale: Adjustments for timbgpio_probe() SF Markus Elfring
2018-02-10 20:31 ` SF Markus Elfring
2018-02-10 20:32 ` [PATCH 1/2] gpio: timberdale: Delete an error message for a failed memory allocation in timbgpio_probe() SF Markus Elfring
2018-02-10 20:32   ` [PATCH 1/2] gpio: timberdale: Delete an error message for a failed memory allocation in timbgpio_pro SF Markus Elfring
2018-02-22 14:14   ` [PATCH 1/2] gpio: timberdale: Delete an error message for a failed memory allocation in timbgpio_probe() Linus Walleij
2018-02-22 14:14     ` [PATCH 1/2] gpio: timberdale: Delete an error message for a failed memory allocation in timbgpio Linus Walleij
2018-02-10 20:33 ` [PATCH 2/2] gpio: timberdale: Improve a size determination in timbgpio_probe() SF Markus Elfring
2018-02-10 20:33   ` SF Markus Elfring
2018-02-22 14:15   ` Linus Walleij
2018-02-22 14:15     ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.