Skip to contentSkip to conversation

GPIO-OMAP: Adjustments for omap_gpio_probe()

PATCH In review SF Markus Elfring 3 participants 6 messages Feb 10, 2018 – Feb 22, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover GPIO-OMAP: Adjustments for omap_gpio_probe()

From: Markus Elfring <[email protected]>
Date: Sat, 10 Feb 2018 21:56:54 +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-omap.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
Signature · 1 line
2.16.1
#1 lore raw

PATCH 1/2 gpio: omap: Delete an error message for a failed memory allocation in omap_gpio_probe()

From: Markus Elfring <[email protected]>
Date: Sat, 10 Feb 2018 21:46:30 +0100

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

This issue was detected by using the Coccinelle software.

---
 drivers/gpio/gpio-omap.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-omap.c +1 -3
index ab5035b96886..4db6f13fa133 100644
@@ -1158,10 +1158,8 @@ static int omap_gpio_probe(struct platform_device *pdev)
 		return -EINVAL;
 
 	bank = devm_kzalloc(dev, sizeof(struct gpio_bank), GFP_KERNEL);
-	if (!bank) {
-		dev_err(dev, "Memory alloc failed\n");
+	if (!bank)
 		return -ENOMEM;
-	}
 
 	irqc = devm_kzalloc(dev, sizeof(*irqc), GFP_KERNEL);
 	if (!irqc)
Signature · 1 line
2.16.1
#2 lore raw

Re: [PATCH 1/2] gpio: omap: Delete an error message for a failed memory allocation in omap_gpio_probe()

Quoted 8 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Sat, 10 Feb 2018 21:46:30 +0100

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

This issue was detected by using the Coccinelle software.

Patch applied.

Yours,
Linus Walleij

#3 lore raw

PATCH 2/2 gpio: omap: Improve a size determination in omap_gpio_probe()

In reply to SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Sat, 10 Feb 2018 21:49:22 +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.

---
 drivers/gpio/gpio-omap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-omap.c +1 -1
index 4db6f13fa133..35971a341c40 100644
@@ -1157,7 +1157,7 @@ static int omap_gpio_probe(struct platform_device *pdev)
 	if (!pdata)
 		return -EINVAL;
 
-	bank = devm_kzalloc(dev, sizeof(struct gpio_bank), GFP_KERNEL);
+	bank = devm_kzalloc(dev, sizeof(*bank), GFP_KERNEL);
 	if (!bank)
 		return -ENOMEM;
 
Signature · 1 line
2.16.1
#4 lore raw

Re: [PATCH 2/2] gpio: omap: Improve a size determination in omap_gpio_probe()

Quoted 10 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Sat, 10 Feb 2018 21:49:22 +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.

Patch applied.

Yours,
Linus Walleij

maintainer Acked-by on the v1 series
#5 lore raw
In reply to SF Markus Elfring
Quoted 6 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Sat, 10 Feb 2018 21:56:54 +0100

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

Quoted 7 lines

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

  drivers/gpio/gpio-omap.c | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)

For series:

Signature · 2 lines
regards,
-grygorii