public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8723bs: replace rtw_sprintf with scnprintf
@ 2025-10-25 19:36 rafiqul713
  2025-10-26  8:33 ` Greg KH
  2025-10-27  7:52 ` Dan Carpenter
  0 siblings, 2 replies; 5+ messages in thread
From: rafiqul713 @ 2025-10-25 19:36 UTC (permalink / raw)
  To: linux-staging; +Cc: rafiqul713

Signed-off-by: rafiqul713 <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__)
 
 #endif
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] staging: rtl8723bs: replace rtw_sprintf with scnprintf
  2025-10-25 19:36 rafiqul713
@ 2025-10-26  8:33 ` Greg KH
  2025-10-27  7:52 ` Dan Carpenter
  1 sibling, 0 replies; 5+ messages in thread
From: Greg KH @ 2025-10-26  8:33 UTC (permalink / raw)
  To: rafiqul713; +Cc: linux-staging

On Sat, Oct 25, 2025 at 09:36:58PM +0200, rafiqul713 wrote:
> Signed-off-by: rafiqul713 <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__)
>  
>  #endif
> -- 
> 2.34.1
> 
> 

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- You did not specify a description of why the patch is needed, or
  possibly, any description at all, in the email body.  Please read the
  section entitled "The canonical patch format" in the kernel file,
  Documentation/process/submitting-patches.rst for what is needed in
  order to properly describe the change.

- You did not write a descriptive Subject: for the patch, allowing Greg,
  and everyone else, to know what this patch is all about.  Please read
  the section entitled "The canonical patch format" in the kernel file,
  Documentation/process/submitting-patches.rst for what a proper
  Subject: line should look like.

- It looks like you did not use your "real" name for the patch on either
  the Signed-off-by: line, or the From: line (both of which have to
  match).  Please read the kernel file,
  Documentation/process/submitting-patches.rst for how to do this
  correctly.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] staging: rtl8723bs: replace rtw_sprintf with scnprintf
@ 2025-10-26  9:04 rafiqul713
  2025-10-26  9:17 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: rafiqul713 @ 2025-10-26  9:04 UTC (permalink / raw)
  To: linux-staging; +Cc: rafiqul713

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__)
 
 #endif
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] staging: rtl8723bs: replace rtw_sprintf with scnprintf
  2025-10-26  9:04 [PATCH] staging: rtl8723bs: replace rtw_sprintf with scnprintf rafiqul713
@ 2025-10-26  9:17 ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2025-10-26  9:17 UTC (permalink / raw)
  To: rafiqul713; +Cc: linux-staging

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] staging: rtl8723bs: replace rtw_sprintf with scnprintf
  2025-10-25 19:36 rafiqul713
  2025-10-26  8:33 ` Greg KH
@ 2025-10-27  7:52 ` Dan Carpenter
  1 sibling, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2025-10-27  7:52 UTC (permalink / raw)
  To: rafiqul713; +Cc: linux-staging

On Sat, Oct 25, 2025 at 09:36:58PM +0200, rafiqul713 wrote:
> Signed-off-by: rafiqul713 <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__)

Just delete rtw_sprintf() and fix the callers to use scnprintf() instead.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-10-27  7:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-26  9:04 [PATCH] staging: rtl8723bs: replace rtw_sprintf with scnprintf rafiqul713
2025-10-26  9:17 ` Greg KH
  -- 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox