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] staging: rtl8712: use kmalloc_array
Date: Sun, 22 Sep 2024 20:58:04 +0200 [thread overview]
Message-ID: <eb3000aa-6bfe-484b-8717-5d98681f6230@gmail.com> (raw)
In-Reply-To: <ZvBX_mugFRQHMq1r@MacBook-Pro.local>
On 9/22/24 7:46 PM, Tudor Gheorghiu wrote:
> use kmalloc_array instead of kmalloc with multiply
>
> Signed-off-by: Tudor Gheorghiu <tudor.reda@gmail.com>
> ---
> 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;
Hi Tudor,
please improve your patch description. Better omit what you are changing
as this can be seen in the change itself. Do focus on why this patch
makes the code better. Please use a full sentence starting with an upper
letter and ends with a ".".
If you send in a second version of this patch please use a change
history. Description from Dan under:
https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/
Thanks for your support.
Bye Philipp
prev parent reply other threads:[~2024-09-22 18:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-22 17:46 [PATCH] staging: rtl8712: use kmalloc_array Tudor Gheorghiu
2024-09-22 18:58 ` 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=eb3000aa-6bfe-484b-8717-5d98681f6230@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