lkml.org 
[lkml]   [2022]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] staging: r8188eu: Prefer kcalloc over kzalloc
From
On 12/16/22 23:39, Kang Minchul wrote:
> 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 <tegongkang@gmail.com>
> ---
> drivers/staging/r8188eu/core/rtw_xmit.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c
> index 34494f08c0cd..36ce1e3f9c81 100644
> --- a/drivers/staging/r8188eu/core/rtw_xmit.c
> +++ b/drivers/staging/r8188eu/core/rtw_xmit.c
> @@ -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;
>

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150

\
 
 \ /
  Last update: 2022-12-17 10:37    [W:0.043 / U:0.652 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site