pinctrl/nomadik/abx500: Adjustments for abx500_gpio_probe()
Subsystems (4)
cover pinctrl/nomadik/abx500: Adjustments for abx500_gpio_probe()
From: Markus Elfring <[email protected]>
Date: Wed, 20 Dec 2017 10:45:01 +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/pinctrl/nomadik/pinctrl-abx500.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
Signature · 1 line
2.15.1
PATCH 1/2 pinctrl/nomadik/abx500: Delete an error message for a failed memory allocation in abx500_gpio_probe()
From: Markus Elfring <[email protected]>
Date: Wed, 20 Dec 2017 10:12:56 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
--- drivers/pinctrl/nomadik/pinctrl-abx500.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/pinctrl/nomadik/pinctrl-abx500.c +1 -4
@@ -1157,11 +1157,8 @@ static int abx500_gpio_probe(struct platform_device *pdev) pct =devm_kzalloc (&pdev->dev,sizeof (struct abx500_pinctrl ),GFP_KERNEL ); -if (pct =NULL ) { -dev_err (&pdev->dev, -"failed to allocate memory for pct\n" ); +if (!pct)return -ENOMEM ; - } pct->dev = &pdev->dev; pct->parent =dev_get_drvdata (pdev->dev.parent);
Signature · 1 line
2.15.1
PATCH 2/2 pinctrl/nomadik/abx500: Improve a size determination in abx500_gpio_probe()
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Wed, 20 Dec 2017 10:22:53 +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/pinctrl/nomadik/pinctrl-abx500.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pinctrl/nomadik/pinctrl-abx500.c +1 -2
@@ -1155,8 +1155,7 @@ static int abx500_gpio_probe(struct platform_device *pdev)return -ENODEV ; } - pct =devm_kzalloc (&pdev->dev,sizeof (struct abx500_pinctrl ), -GFP_KERNEL ); + pct =devm_kzalloc (&pdev->dev,sizeof (*pct),GFP_KERNEL );if (!pct)return -ENOMEM ;
Signature · 1 line
2.15.1
Re: [PATCH 1/2] pinctrl/nomadik/abx500: Delete an error message for a failed memory allocation in abx500_gpio_probe()
In reply to SF Markus ElfringQuoted 8 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Wed, 20 Dec 2017 10:12:56 +0100Omit 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 <[email protected]>
Patch applied.
Yours,
Linus Walleij
Re: [PATCH 2/2] pinctrl/nomadik/abx500: Improve a size determination in abx500_gpio_probe()
In reply to SF Markus ElfringQuoted 10 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Wed, 20 Dec 2017 10:22:53 +0100Replace 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 <[email protected]>
Patch applied.
Yours,
Linus Walleij