From: Philipp Hortmann <philipp.g.hortmann@gmail.com>
To: Tudor Gheorghiu <tudor.reda@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
Florian Schilhabel <florian.c.schilhabel@googlemail.com>,
Linux Driver Project Developer List
<driverdev-devel@linuxdriverproject.org>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] staging: rtl8712: use kmalloc_array
Date: Sun, 22 Sep 2024 22:46:32 +0200 [thread overview]
Message-ID: <525a7e43-d8d8-4973-8e3a-ac6b53785d6d@gmail.com> (raw)
In-Reply-To: <ZvBy2lB_ok_OCmVI@redaops>
On 9/22/24 9:41 PM, Tudor Gheorghiu wrote:
> Adhere to Linux kernel coding style.
>
> Reported by checkpatch:
>
> WARNING: Prefer kmalloc_array over kmalloc with multiply
> + pxmitpriv->pxmitbuf = kmalloc(NR_XMITBUFF * sizeof(struct xmit_buf), GFP_ATOMIC);
>
> Signed-off-by: Tudor Gheorghiu <tudor.reda@gmail.com>
> ---
> v2: Update patch description
> ---
> drivers/staging/rtl8712/rtl871x_xmit.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/rtl8712/rtl871x_xmit.c b/drivers/staging/rtl8712/rtl871x_xmit.c
> index 408616e9afcf..a0f29fab3dce 100644
> --- a/drivers/staging/rtl8712/rtl871x_xmit.c
> +++ b/drivers/staging/rtl8712/rtl871x_xmit.c
> @@ -117,7 +117,7 @@ int _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv,
> /*init xmit_buf*/
> _init_queue(&pxmitpriv->free_xmitbuf_queue);
> _init_queue(&pxmitpriv->pending_xmitbuf_queue);
> - pxmitpriv->pxmitbuf = kmalloc(NR_XMITBUFF * sizeof(struct xmit_buf), GFP_ATOMIC);
> + pxmitpriv->pxmitbuf = kmalloc_array(NR_XMITBUFF, sizeof(struct xmit_buf), GFP_ATOMIC);
> if (!pxmitpriv->pxmitbuf)
> goto clean_up_frame_buf;
> pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmitbuf;
Reviewed-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
prev parent reply other threads:[~2024-09-22 20:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-22 19:41 Tudor Gheorghiu
2024-09-22 20:46 ` Philipp Hortmann [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=525a7e43-d8d8-4973-8e3a-ac6b53785d6d@gmail.com \
--to=philipp.g.hortmann@gmail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=driverdev-devel@linuxdriverproject.org \
--cc=florian.c.schilhabel@googlemail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=tudor.reda@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®