Forráskód Böngészése

Staging: sm7xx: preferred form for passing a size to memory allocation routines

The preferred form for passing a size of a struct is the following:
p = kmalloc(sizeof(*p), ...);
Please refer Documentation/Codingstyle chapter 14

Signed-off-by: anish kumar <anish198519851985@gmail.com>
Acked-by: Harry Wei <harryxiyou@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
anish kumar 14 éve
szülő
commit
617a0c7177
1 módosított fájl, 1 hozzáadás és 1 törlés
  1. 1 1
      drivers/staging/sm7xx/smtcfb.c

+ 1 - 1
drivers/staging/sm7xx/smtcfb.c

@@ -714,7 +714,7 @@ static struct smtcfb_info *smtc_alloc_fb_info(struct pci_dev *dev,
 {
 	struct smtcfb_info *sfb;
 
-	sfb = kzalloc(sizeof(struct smtcfb_info), GFP_KERNEL);
+	sfb = kzalloc(sizeof(*sfb), GFP_KERNEL);
 
 	if (!sfb)
 		return NULL;