summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorsayli karnik <karniksayli1995@gmail.com>2016-09-16 16:23:02 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-09-17 23:32:13 +0200
commitfaa48ea82bcd4b186dd548529d2514a9a2892095 (patch)
treeb441e64086b6a5e0a9d9bcf3ae35fca3f90828b7 /drivers
parentd7c952a3664c5f52a1a117327a9e32e64cc74ed4 (diff)
downloadlinux-faa48ea82bcd4b186dd548529d2514a9a2892095.tar.bz2
staging: wilc1000: Use sizeof type *pointer instead of sizeof type
The patch uses the size of the dereference to a variable instead of it's type, to make the code more resistant to type changes in the future. The type of the pointer variable here is the same as the type in the argument that is being replaced in sizeof(). Signed-off-by: sayli karnik <karniksayli1995@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/wilc1000/host_interface.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 78f524fcd214..d0cb568c94b1 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3329,7 +3329,7 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
init_completion(&hif_wait_response);
- hif_drv = kzalloc(sizeof(struct host_if_drv), GFP_KERNEL);
+ hif_drv = kzalloc(sizeof(*hif_drv), GFP_KERNEL);
if (!hif_drv) {
result = -ENOMEM;
goto _fail_;
@@ -3878,7 +3878,7 @@ static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo)
pu8IEs = ptstrNetworkInfo->ies;
u16IEsLen = ptstrNetworkInfo->ies_len;
- pNewJoinBssParam = kzalloc(sizeof(struct join_bss_param), GFP_KERNEL);
+ pNewJoinBssParam = kzalloc(sizeof(*pNewJoinBssParam), GFP_KERNEL);
if (pNewJoinBssParam) {
pNewJoinBssParam->dtim_period = ptstrNetworkInfo->dtim_period;
pNewJoinBssParam->beacon_period = ptstrNetworkInfo->beacon_period;