]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
video: s3c-fb: Improve a size determination in s3c_fb_probe()
authorMarkus Elfring <elfring@users.sourceforge.net>
Wed, 28 Mar 2018 14:34:28 +0000 (16:34 +0200)
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Wed, 28 Mar 2018 14:34:28 +0000 (16:34 +0200)
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>
Acked-by: Jingoo Han <jingoohan1@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
drivers/video/fbdev/s3c-fb.c

index 0914c973cbd9bac4fc05a2581f2a25525e3f483e..8c7623d63eb1c43accca85bb6774fba4d555cfa5 100644 (file)
@@ -1383,7 +1383,7 @@ static int s3c_fb_probe(struct platform_device *pdev)
                return -EINVAL;
        }
 
-       sfb = devm_kzalloc(dev, sizeof(struct s3c_fb), GFP_KERNEL);
+       sfb = devm_kzalloc(dev, sizeof(*sfb), GFP_KERNEL);
        if (!sfb)
                return -ENOMEM;