Linux USB
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: udc: renesas_usb3: Fix compiler warning
@ 2025-01-22  2:50 guoren
  2025-01-22  4:59 ` Yoshihiro Shimoda
  0 siblings, 1 reply; 3+ messages in thread
From: guoren @ 2025-01-22  2:50 UTC (permalink / raw)
  To: palmer, guoren, conor, geert+renesas, prabhakar.mahadev-lad.rj
  Cc: linux-riscv, linux-kernel, linux-usb, gregkh, Guo Ren, stable,
	kernel test robot

From: Guo Ren <guoren@linux.alibaba.com>

drivers/usb/gadget/udc/renesas_usb3.c: In function 'renesas_usb3_probe':
drivers/usb/gadget/udc/renesas_usb3.c:2638:73: warning: '%d'
directive output may be truncated writing between 1 and 11 bytes into a
region of size 6 [-Wformat-truncation=]
2638 |   snprintf(usb3_ep->ep_name, sizeof(usb3_ep->ep_name), "ep%d", i);
                                    ^~~~~~~~~~~~~~~~~~~~~~~~     ^~   ^

Fixes: 8292493c22c8 ("riscv: Kconfig.socs: Add ARCH_RENESAS kconfig option")
Cc: stable@vger.kernel.org
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202501201409.BIQPtkeB-lkp@intel.com/
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Signed-off-by: Guo Ren <guoren@kernel.org>
---
 drivers/usb/gadget/udc/renesas_usb3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c
index fce5c41d9f29..89b304cf6d03 100644
--- a/drivers/usb/gadget/udc/renesas_usb3.c
+++ b/drivers/usb/gadget/udc/renesas_usb3.c
@@ -310,7 +310,7 @@ struct renesas_usb3_request {
 	struct list_head	queue;
 };
 
-#define USB3_EP_NAME_SIZE	8
+#define USB3_EP_NAME_SIZE	16
 struct renesas_usb3_ep {
 	struct usb_ep ep;
 	struct renesas_usb3 *usb3;
-- 
2.40.1


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

* RE: [PATCH] usb: gadget: udc: renesas_usb3: Fix compiler warning
  2025-01-22  2:50 [PATCH] usb: gadget: udc: renesas_usb3: Fix compiler warning guoren
@ 2025-01-22  4:59 ` Yoshihiro Shimoda
  2025-01-22  8:06   ` Guo Ren
  0 siblings, 1 reply; 3+ messages in thread
From: Yoshihiro Shimoda @ 2025-01-22  4:59 UTC (permalink / raw)
  To: guoren@kernel.org, palmer@dabbelt.com, conor@kernel.org,
	geert+renesas@glider.be, Prabhakar Mahadev Lad
  Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org, gregkh@linuxfoundation.org, Guo Ren,
	stable@vger.kernel.org, kernel test robot

Hello,

Thank you for the patch!

> From: guoren@kernel.org, Sent: Wednesday, January 22, 2025 11:50 AM
> 
> From: Guo Ren <guoren@linux.alibaba.com>
> 
> drivers/usb/gadget/udc/renesas_usb3.c: In function 'renesas_usb3_probe':
> drivers/usb/gadget/udc/renesas_usb3.c:2638:73: warning: '%d'
> directive output may be truncated writing between 1 and 11 bytes into a
> region of size 6 [-Wformat-truncation=]
> 2638 |   snprintf(usb3_ep->ep_name, sizeof(usb3_ep->ep_name), "ep%d", i);
>                                     ^~~~~~~~~~~~~~~~~~~~~~~~     ^~   ^

Just a record. Since the maximum number of ep is up to 16, such an overflow
will not occur actually. Anyway, fixing this compiler warning is good.

> Fixes: 8292493c22c8 ("riscv: Kconfig.socs: Add ARCH_RENESAS kconfig option")

Please use the following Fixes tag:

Fixes: 746bfe63bba3 ("usb: gadget: renesas_usb3: add support for Renesas USB3.0 peripheral controller")

Best regards,
Yoshihiro Shimoda

> Cc: stable@vger.kernel.org
> Reported-by: kernel test robot <lkp@intel.com>
<snip URL>
> Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
> Signed-off-by: Guo Ren <guoren@kernel.org>
> ---
>  drivers/usb/gadget/udc/renesas_usb3.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c
> index fce5c41d9f29..89b304cf6d03 100644
> --- a/drivers/usb/gadget/udc/renesas_usb3.c
> +++ b/drivers/usb/gadget/udc/renesas_usb3.c
> @@ -310,7 +310,7 @@ struct renesas_usb3_request {
>  	struct list_head	queue;
>  };
> 
> -#define USB3_EP_NAME_SIZE	8
> +#define USB3_EP_NAME_SIZE	16
>  struct renesas_usb3_ep {
>  	struct usb_ep ep;
>  	struct renesas_usb3 *usb3;
> --
> 2.40.1
> 


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

* Re: [PATCH] usb: gadget: udc: renesas_usb3: Fix compiler warning
  2025-01-22  4:59 ` Yoshihiro Shimoda
@ 2025-01-22  8:06   ` Guo Ren
  0 siblings, 0 replies; 3+ messages in thread
From: Guo Ren @ 2025-01-22  8:06 UTC (permalink / raw)
  To: Yoshihiro Shimoda
  Cc: palmer@dabbelt.com, conor@kernel.org, geert+renesas@glider.be,
	Prabhakar Mahadev Lad, linux-riscv@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	gregkh@linuxfoundation.org, Guo Ren, stable@vger.kernel.org,
	kernel test robot

On Wed, Jan 22, 2025 at 12:59 PM Yoshihiro Shimoda
<yoshihiro.shimoda.uh@renesas.com> wrote:
>
> Hello,
>
> Thank you for the patch!
>
> > From: guoren@kernel.org, Sent: Wednesday, January 22, 2025 11:50 AM
> >
> > From: Guo Ren <guoren@linux.alibaba.com>
> >
> > drivers/usb/gadget/udc/renesas_usb3.c: In function 'renesas_usb3_probe':
> > drivers/usb/gadget/udc/renesas_usb3.c:2638:73: warning: '%d'
> > directive output may be truncated writing between 1 and 11 bytes into a
> > region of size 6 [-Wformat-truncation=]
> > 2638 |   snprintf(usb3_ep->ep_name, sizeof(usb3_ep->ep_name), "ep%d", i);
> >                                     ^~~~~~~~~~~~~~~~~~~~~~~~     ^~   ^
>
> Just a record. Since the maximum number of ep is up to 16, such an overflow
> will not occur actually. Anyway, fixing this compiler warning is good.
>
> > Fixes: 8292493c22c8 ("riscv: Kconfig.socs: Add ARCH_RENESAS kconfig option")
>
> Please use the following Fixes tag:
>
> Fixes: 746bfe63bba3 ("usb: gadget: renesas_usb3: add support for Renesas USB3.0 peripheral controller")
Okay

>
> Best regards,
> Yoshihiro Shimoda
>
> > Cc: stable@vger.kernel.org
> > Reported-by: kernel test robot <lkp@intel.com>
> <snip URL>
> > Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
> > Signed-off-by: Guo Ren <guoren@kernel.org>
> > ---
> >  drivers/usb/gadget/udc/renesas_usb3.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c
> > index fce5c41d9f29..89b304cf6d03 100644
> > --- a/drivers/usb/gadget/udc/renesas_usb3.c
> > +++ b/drivers/usb/gadget/udc/renesas_usb3.c
> > @@ -310,7 +310,7 @@ struct renesas_usb3_request {
> >       struct list_head        queue;
> >  };
> >
> > -#define USB3_EP_NAME_SIZE    8
> > +#define USB3_EP_NAME_SIZE    16
> >  struct renesas_usb3_ep {
> >       struct usb_ep ep;
> >       struct renesas_usb3 *usb3;
> > --
> > 2.40.1
> >
>


-- 
Best Regards
 Guo Ren

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

end of thread, other threads:[~2025-01-22  8:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-22  2:50 [PATCH] usb: gadget: udc: renesas_usb3: Fix compiler warning guoren
2025-01-22  4:59 ` Yoshihiro Shimoda
2025-01-22  8:06   ` Guo Ren

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