From: Greg KH <gregkh@linuxfoundation.org>
To: rafiqul713 <rafiqul713@gmail.com>
Cc: linux-staging@lists.linux.dev
Subject: Re: [PATCH] staging: rtl8723bs: replace rtw_sprintf with scnprintf
Date: Sun, 26 Oct 2025 10:17:31 +0100 [thread overview]
Message-ID: <2025102639-pyramid-footless-7834@gregkh> (raw)
In-Reply-To: <20251026090438.116509-1-rafiqul713@gmail.com>
On Sun, Oct 26, 2025 at 10:04:38AM +0100, rafiqul713 wrote:
> From: Rafiqul Islam <rafiqul713@gmail.com>
>
> The rtw_sprintf macro used an old-style varargs macro. Replace it with scnprintf()
> to ensure buffer bounds are honoured and to align with kernel conventions.
> This change is a safe refactor (no functional change) and improves robustness
> against potential buffer overruns.
>
> Tested: built driver tree (module build) and no runtime changes expected.
>
> Signed-off-by: Rafiqul Islam <rafiqul713@gmail.com>
> ---
> drivers/staging/rtl8723bs/include/osdep_service.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/rtl8723bs/include/osdep_service.h b/drivers/staging/rtl8723bs/include/osdep_service.h
> index 8b1634f4091e..019792d0595a 100644
> --- a/drivers/staging/rtl8723bs/include/osdep_service.h
> +++ b/drivers/staging/rtl8723bs/include/osdep_service.h
> @@ -119,6 +119,6 @@ struct rtw_cbuf *rtw_cbuf_alloc(u32 size);
> /*
> * Write formatted output to sized buffer
> */
> -#define rtw_sprintf(buf, size, format, arg...) snprintf(buf, size, format, ##arg)
> +#define rtw_sprintf(buf, size, fmt, ...) scnprintf(buf, size, fmt, ##__VA_ARGS__)
Why change this at all, it is not used anywhere, so why not just delete
this?
And this is the second version of this patch, it should have been "v2",
right?
thanks,
greg k-h
next prev parent reply other threads:[~2025-10-26 9:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-26 9:04 [PATCH] staging: rtl8723bs: replace rtw_sprintf with scnprintf rafiqul713
2025-10-26 9:17 ` Greg KH [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-10-25 19:36 rafiqul713
2025-10-26 8:33 ` Greg KH
2025-10-27 7:52 ` Dan Carpenter
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=2025102639-pyramid-footless-7834@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=linux-staging@lists.linux.dev \
--cc=rafiqul713@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