video/fbdev/au1100fb: Adjustments for au1100fb_drv_probe()
Subsystems (2)
cover video/fbdev/au1100fb: Adjustments for au1100fb_drv_probe()
From: Markus Elfring <[email protected]>
Date: Mon, 27 Nov 2017 18:53:21 +0100
Three update suggestions were taken into account
from static source code analysis.
Markus Elfring (3):
Delete an error message for a failed memory allocation Improve a size determination
Delete an unnecessary variable initialisation
drivers/video/fbdev/au1100fb.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
Signature · 1 line
2.15.0
PATCH 1/3 video: au1100fb: Delete an error message for a failed memory allocation in au1100fb_drv_probe()
From: Markus Elfring <[email protected]>
Date: Mon, 27 Nov 2017 18:14:41 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
--- drivers/video/fbdev/au1100fb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/video/fbdev/au1100fb.c +1 -3
@@ -418,10 +418,8 @@ static int au1100fb_drv_probe(struct platform_device *dev)/* Allocate new device private */ fbdev =devm_kzalloc (&dev->dev,sizeof (struct au1100fb_device ),GFP_KERNEL ); -if (!fbdev) { -print_err ("fail to allocate device private record" ); +if (!fbdev)return -ENOMEM ; - }if (au1100fb_setup (fbdev)) goto failed;
Signature · 1 line
2.15.0
Re: [PATCH 1/3] video: au1100fb: Delete an error message for a failed memory allocation in au1100fb_drv_probe()
Quoted 8 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Mon, 27 Nov 2017 18:14:41 +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 queued for 4.17, thanks.
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
PATCH 2/3 video: au1100fb: Improve a size determination in au1100fb_drv_probe()
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Mon, 27 Nov 2017 18:18:34 +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/video/fbdev/au1100fb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/video/fbdev/au1100fb.c +1 -2
@@ -416,8 +416,7 @@ static int au1100fb_drv_probe(struct platform_device *dev)struct clk *c;/* Allocate new device private */ - fbdev =devm_kzalloc (&dev->dev,sizeof (struct au1100fb_device ), -GFP_KERNEL ); + fbdev =devm_kzalloc (&dev->dev,sizeof (*fbdev),GFP_KERNEL );if (!fbdev)return -ENOMEM ;
Signature · 1 line
2.15.0
Re: [PATCH 2/3] video: au1100fb: Improve a size determination in au1100fb_drv_probe()
Quoted 10 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Mon, 27 Nov 2017 18:18:34 +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 queued for 4.17, thanks.
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
PATCH 3/3 video: au1100fb: Delete an unnecessary variable initialisation in au1100fb_drv_probe()
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Mon, 27 Nov 2017 18:40:23 +0100
The local variable "fbdev" will be reassigned by a following statement. Thus omit the explicit initialisation at the beginning.
--- drivers/video/fbdev/au1100fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/au1100fb.c +1 -1
@@ -410,7 +410,7 @@ static int au1100fb_setup(struct au1100fb_device *fbdev)static int au1100fb_drv_probe (struct platform_device *dev) { -struct au1100fb_device *fbdev =NULL ; +struct au1100fb_device *fbdev;struct resource *regs_res;unsigned long page;struct clk *c;
Signature · 1 line
2.15.0
Re: [PATCH 3/3] video: au1100fb: Delete an unnecessary variable initialisation in au1100fb_drv_probe()
Quoted 7 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Mon, 27 Nov 2017 18:40:23 +0100The local variable "fbdev" will be reassigned by a following statement. Thus omit the explicit initialisation at the beginning.
Signed-off-by Markus Elfring <[email protected]>
Patch queued for 4.17, thanks.
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics