staging: r8188eu: Prefer kcalloc over kzalloc
PATCH 1/1 staging: r8188eu: Prefer kcalloc over kzalloc
Fixed following checkpatch.pl warning:
* WARNING: Prefer kcalloc over kzalloc with multiply
Instead of specifying (number of bytes) * (size) as arugment in kzalloc, prefer kcalloc.
Signed-off-by Kang Minchul <[email protected]>
--- drivers/staging/r8188eu/core/rtw_xmit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/r8188eu/core/rtw_xmit.c +1 -1
@@ -1564,7 +1564,7 @@ int rtw_alloc_hwxmits(struct adapter *padapter) pxmitpriv->hwxmit_entry =HWXMIT_ENTRY ; - pxmitpriv->hwxmits =kzalloc (sizeof (struct hw_xmit ) * pxmitpriv->hwxmit_entry,GFP_KERNEL ); + pxmitpriv->hwxmits =kcalloc (pxmitpriv->hwxmit_entry,sizeof (struct hw_xmit ),GFP_KERNEL );if (!pxmitpriv->hwxmits)return -ENOMEM ;
Signature · 1 line
2.34.1
Quoted 16 lines · Kang Minchul
Fixed following checkpatch.pl warning:
* WARNING: Prefer kcalloc over kzalloc with multiplyInstead of specifying (number of bytes) * (size) as arugment in kzalloc, prefer kcalloc.
Signed-off-by Kang Minchul <[email protected]>--- drivers/staging/r8188eu/core/rtw_xmit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/r8188eu/core/rtw_xmit.c +0
-0
drivers/staging/r8188eu/core/rtw_xmit.c int rtw_alloc_hwxmits(struct adapter *padapter) · line 1570
Quoted 8 lines
drivers/staging/r8188eu/core/rtw_xmit.c +1
-1@@ -1564,7 +1564,7 @@ int rtw_alloc_hwxmits(struct adapter *padapter) pxmitpriv->hwxmit_entry =HWXMIT_ENTRY ; - pxmitpriv->hwxmits =kzalloc (sizeof (struct hw_xmit ) * pxmitpriv->hwxmit_entry,GFP_KERNEL ); + pxmitpriv->hwxmits =kcalloc (pxmitpriv->hwxmit_entry,sizeof (struct hw_xmit ),GFP_KERNEL );if (!pxmitpriv->hwxmits)return -ENOMEM ;
Thus wrote Kang Minchul ([email protected]):
Quoted 26 lines
Fixed following checkpatch.pl warning:
* WARNING: Prefer kcalloc over kzalloc with multiplyInstead of specifying (number of bytes) * (size) as arugment in kzalloc, prefer kcalloc.
Signed-off-by Kang Minchul <[email protected]>--- drivers/staging/r8188eu/core/rtw_xmit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/r8188eu/core/rtw_xmit.c +1
-1@@ -1564,7 +1564,7 @@ int rtw_alloc_hwxmits(struct adapter *padapter) pxmitpriv->hwxmit_entry =HWXMIT_ENTRY ; - pxmitpriv->hwxmits =kzalloc (sizeof (struct hw_xmit ) * pxmitpriv->hwxmit_entry,GFP_KERNEL ); + pxmitpriv->hwxmits =kcalloc (pxmitpriv->hwxmit_entry,sizeof (struct hw_xmit ),GFP_KERNEL );if (!pxmitpriv->hwxmits)return -ENOMEM ;Signature · 1 line
2.34.1
Reviewed-by Martin Kaiser <[email protected]>