* [PATCH] staging: r8188eu: Prefer kcalloc over kzalloc
@ 2022-12-16 22:39 Kang Minchul
2022-12-17 9:35 ` Philipp Hortmann
2022-12-18 15:50 ` Martin Kaiser
0 siblings, 2 replies; 3+ messages in thread
From: Kang Minchul @ 2022-12-16 22:39 UTC (permalink / raw)
To: Larry Finger, Phillip Potter
Cc: Pavel Skripkin, Greg Kroah-Hartman, linux-staging, linux-kernel,
Kang Minchul
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;
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] staging: r8188eu: Prefer kcalloc over kzalloc
2022-12-16 22:39 [PATCH] staging: r8188eu: Prefer kcalloc over kzalloc Kang Minchul
@ 2022-12-17 9:35 ` Philipp Hortmann
2022-12-18 15:50 ` Martin Kaiser
1 sibling, 0 replies; 3+ messages in thread
From: Philipp Hortmann @ 2022-12-17 9:35 UTC (permalink / raw)
To: Kang Minchul, Larry Finger, Phillip Potter
Cc: Pavel Skripkin, Greg Kroah-Hartman, linux-staging, linux-kernel
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] staging: r8188eu: Prefer kcalloc over kzalloc
2022-12-16 22:39 [PATCH] staging: r8188eu: Prefer kcalloc over kzalloc Kang Minchul
2022-12-17 9:35 ` Philipp Hortmann
@ 2022-12-18 15:50 ` Martin Kaiser
1 sibling, 0 replies; 3+ messages in thread
From: Martin Kaiser @ 2022-12-18 15:50 UTC (permalink / raw)
To: Kang Minchul
Cc: Larry Finger, Phillip Potter, Pavel Skripkin, Greg Kroah-Hartman,
linux-staging, linux-kernel
Thus wrote Kang Minchul (tegongkang@gmail.com):
> 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;
> --
> 2.34.1
Reviewed-by: Martin Kaiser <martin@kaiser.cx>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-12-18 16:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-16 22:39 [PATCH] staging: r8188eu: Prefer kcalloc over kzalloc Kang Minchul
2022-12-17 9:35 ` Philipp Hortmann
2022-12-18 15:50 ` Martin Kaiser
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.