Skip to content

Commit

Permalink
Staging: sm7xx: preferred form for passing a size to memory allocatio…
Browse files Browse the repository at this point in the history
…n 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>
  • Loading branch information
anish kumar authored and Greg Kroah-Hartman committed May 19, 2011
1 parent 1639c8a commit 617a0c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/sm7xx/smtcfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 617a0c7

Please sign in to comment.