Skip to contentSkip to conversation

video/fbdev/amba-clcd: Adjustments for clcdfb_probe()

PATCH In review SF Markus Elfring 2 participants 5 messages Dec 5, 2017 – Mar 28, 2018

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

cover video/fbdev/amba-clcd: Adjustments for clcdfb_probe()

From: Markus Elfring <[email protected]>
Date: Tue, 5 Dec 2017 18:07:06 +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/video/fbdev/amba-clcd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
Signature · 1 line
2.15.1
#1 lore raw

PATCH 1/2 video: ARM CLCD: Delete an error message for a failed memory allocation in clcdfb_probe()

From: Markus Elfring <[email protected]>
Date: Tue, 5 Dec 2017 17:50:11 +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/amba-clcd.c | 1 -
 1 file changed, 1 deletion(-)
drivers/video/fbdev/amba-clcd.c +0 -1
index 36d25190b48c..79f5ebf23fcd 100644
@@ -969,7 +969,6 @@ static int clcdfb_probe(struct amba_device *dev, const struct amba_id *id)
 
 	fb = kzalloc(sizeof(struct clcd_fb), GFP_KERNEL);
 	if (!fb) {
-		printk(KERN_INFO "CLCD: could not allocate new clcd_fb struct\n");
 		ret = -ENOMEM;
 		goto free_region;
 	}
Signature · 1 line
2.15.1
#2 lore raw

Re: [PATCH 1/2] video: ARM CLCD: Delete an error message for a failed memory allocation in clcdfb_probe()

Quoted 8 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Tue, 5 Dec 2017 17:50:11 +0100

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

This issue was detected by using the Coccinelle software.

Patch queued for 4.17, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

#3 lore raw

PATCH 2/2 video: ARM CLCD: Improve a size determination in clcdfb_probe()

In reply to SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Tue, 5 Dec 2017 17:53:19 +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/amba-clcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/amba-clcd.c +1 -1
index 79f5ebf23fcd..38c1f324ce15 100644
@@ -967,7 +967,7 @@ static int clcdfb_probe(struct amba_device *dev, const struct amba_id *id)
 		goto out;
 	}
 
-	fb = kzalloc(sizeof(struct clcd_fb), GFP_KERNEL);
+	fb = kzalloc(sizeof(*fb), GFP_KERNEL);
 	if (!fb) {
 		ret = -ENOMEM;
 		goto free_region;
Signature · 1 line
2.15.1
#4 lore raw

Re: [PATCH 2/2] video: ARM CLCD: Improve a size determination in clcdfb_probe()

Quoted 10 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Tue, 5 Dec 2017 17:53:19 +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 queued for 4.17, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics