]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
video: ARM CLCD: Improve a size determination in clcdfb_probe()
authorMarkus Elfring <elfring@users.sourceforge.net>
Wed, 28 Mar 2018 14:34:29 +0000 (16:34 +0200)
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Wed, 28 Mar 2018 14:34:29 +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>
Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
drivers/video/fbdev/amba-clcd.c

index 79f5ebf23fcd9a8c165dd69deec80cd223519685..38c1f324ce15d98d513e7dfd613c9a7e835f5979 100644 (file)
@@ -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;