From: Markus Elfring Date: Thu, 26 Apr 2018 10:24:19 +0000 (+0200) Subject: video: omap: Improve a size determination in omapfb_do_probe() X-Git-Tag: v4.18-rc1~4^2~12 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=85d108dee574c038423f573b6ae93d43d12e971e;p=users%2Fjedix%2Flinux-maple.git video: omap: Improve a size determination in omapfb_do_probe() 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 Cc: Tomi Valkeinen Signed-off-by: Bartlomiej Zolnierkiewicz --- diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c index 3479a47a30820..585f39efcff67 100644 --- a/drivers/video/fbdev/omap/omapfb_main.c +++ b/drivers/video/fbdev/omap/omapfb_main.c @@ -1645,7 +1645,7 @@ static int omapfb_do_probe(struct platform_device *pdev, goto cleanup; } - fbdev = kzalloc(sizeof(struct omapfb_device), GFP_KERNEL); + fbdev = kzalloc(sizeof(*fbdev), GFP_KERNEL); if (fbdev == NULL) { dev_err(&pdev->dev, "unable to allocate memory for device info\n");