Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

video: smscufx: Improve a size determination in two functions

Replace the specification of data structures by pointer dereferences
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Cc: Steve Glendinning <steve.glendinning@shawell.net>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

authored by

Markus Elfring and committed by
Bartlomiej Zolnierkiewicz
defddeff 11ab5a64

+2 -3
+2 -3
drivers/video/fbdev/smscufx.c
··· 1086 1086 1087 1087 struct fb_deferred_io *fbdefio; 1088 1088 1089 - fbdefio = kzalloc(sizeof(struct fb_deferred_io), GFP_KERNEL); 1090 - 1089 + fbdefio = kzalloc(sizeof(*fbdefio), GFP_KERNEL); 1091 1090 if (fbdefio) { 1092 1091 fbdefio->delay = UFX_DEFIO_WRITE_DELAY; 1093 1092 fbdefio->deferred_io = ufx_dpy_deferred_io; ··· 1874 1875 INIT_LIST_HEAD(&dev->urbs.list); 1875 1876 1876 1877 while (i < count) { 1877 - unode = kzalloc(sizeof(struct urb_node), GFP_KERNEL); 1878 + unode = kzalloc(sizeof(*unode), GFP_KERNEL); 1878 1879 if (!unode) 1879 1880 break; 1880 1881 unode->dev = dev;