Staging: slicoss: Use sizeof structure *pointer over sizeof structure in kmalloc()/kzalloc().
PATCH v2 1/1 Staging: slicoss: Use sizeof structure *pointer over sizeof structure in kmalloc()/kzalloc().
Use sizeof structure *pointer over sizeof structure in kmalloc()/kzalloc().
Signed-off-by Sandhya Bankar <[email protected]>
---
Changes in v2:
* No change.
*Compile this patch to check nothing is broken.
drivers/staging/slicoss/slicoss.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/slicoss/slicoss.c +3 -3
@@ -880,7 +880,7 @@ static int slic_upr_queue_request(struct adapter *adapter,struct slic_upr *upr;struct slic_upr *uprqueue; - upr =kmalloc (sizeof (struct slic_upr ),GFP_ATOMIC ); + upr =kmalloc (sizeof (*upr),GFP_ATOMIC );if (!upr)return -ENOMEM ;
@@ -1806,7 +1806,7 @@ static int slic_mcast_add_list(struct adapter *adapter, char *address) }/* Doesn't already exist. Allocate a structure to hold it */ - mcaddr =kmalloc (sizeof (struct mcast_address ),GFP_ATOMIC ); + mcaddr =kmalloc (sizeof (*mcaddr),GFP_ATOMIC );if (!mcaddr)return 1 ;
@@ -3049,7 +3049,7 @@ static u32 slic_card_locate(struct adapter *adapter) }if (!physcard) {/* no structure allocated for this physical card yet */ - physcard =kzalloc (sizeof (struct physcard ),GFP_ATOMIC ); + physcard =kzalloc (sizeof (*physcard),GFP_ATOMIC );if (!physcard) {if (card_hostid ==SLIC_HOSTID_DEFAULT )kfree (card);
Signature · 1 line
1.8.3.4
Greg KH
maintainerQuoted 7 lines · Sandhya Bankar
Use sizeof structure *pointer over sizeof structure in kmalloc()/kzalloc().
Signed-off-by Sandhya Bankar <[email protected]>---
Changes in v2:
* No change.
*Compile this patch to check nothing is broken.
Does not apply to my tree :(