diff options
author | Alexander Beregalov <a.beregalov@gmail.com> | 2011-03-09 03:53:34 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-03-09 15:54:31 -0800 |
commit | f4a0e6b1354cd0bec6aca405883cc45662511f03 (patch) | |
tree | bfc9d55f878ffa36ccef59fab3126a33cd01c458 /drivers/staging/bcm/Misc.c | |
parent | 00b6fb2e31ac668795857c9609adc11e7964ed5a (diff) |
staging: bcm: optimize kmalloc to kzalloc
Use kzalloc rather than kmalloc followed by memset with 0.
Found by coccinelle.
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/bcm/Misc.c')
-rw-r--r-- | drivers/staging/bcm/Misc.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/staging/bcm/Misc.c b/drivers/staging/bcm/Misc.c index f585aae9cf8b..d624f35d0551 100644 --- a/drivers/staging/bcm/Misc.c +++ b/drivers/staging/bcm/Misc.c @@ -498,13 +498,12 @@ VOID LinkMessage(PMINI_ADAPTER Adapter) BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, LINK_UP_MSG, DBG_LVL_ALL, "=====>"); if(Adapter->LinkStatus == SYNC_UP_REQUEST && Adapter->AutoSyncup) { - pstLinkRequest=kmalloc(sizeof(LINK_REQUEST), GFP_ATOMIC); + pstLinkRequest = kzalloc(sizeof(LINK_REQUEST), GFP_ATOMIC); if(!pstLinkRequest) { BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, LINK_UP_MSG, DBG_LVL_ALL, "Can not allocate memory for Link request!"); return; } - memset(pstLinkRequest,0,sizeof(LINK_REQUEST)); //sync up request... Adapter->LinkStatus = WAIT_FOR_SYNC;// current link status BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, LINK_UP_MSG, DBG_LVL_ALL, "Requesting For SyncUp..."); @@ -516,13 +515,12 @@ VOID LinkMessage(PMINI_ADAPTER Adapter) } else if(Adapter->LinkStatus == PHY_SYNC_ACHIVED && Adapter->AutoLinkUp) { - pstLinkRequest=kmalloc(sizeof(LINK_REQUEST), GFP_ATOMIC); + pstLinkRequest = kzalloc(sizeof(LINK_REQUEST), GFP_ATOMIC); if(!pstLinkRequest) { BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, LINK_UP_MSG, DBG_LVL_ALL, "Can not allocate memory for Link request!"); return; } - memset(pstLinkRequest,0,sizeof(LINK_REQUEST)); //LINK_UP_REQUEST BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, LINK_UP_MSG, DBG_LVL_ALL, "Requesting For LinkUp..."); pstLinkRequest->szData[0]=LINK_UP_REQ_PAYLOAD; |