[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJF2gTQTLHjKa9SJLnh1fpQK-kVC1_pjFD3geiusa-QKzh4FQg@mail.gmail.com>
Date: Wed, 22 Jan 2025 16:06:02 +0800
From: Guo Ren <guoren@...nel.org>
To: Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>
Cc: "palmer@...belt.com" <palmer@...belt.com>, "conor@...nel.org" <conor@...nel.org>,
"geert+renesas@...der.be" <geert+renesas@...der.be>,
Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@...renesas.com>,
"linux-riscv@...ts.infradead.org" <linux-riscv@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>, Guo Ren <guoren@...ux.alibaba.com>,
"stable@...r.kernel.org" <stable@...r.kernel.org>, kernel test robot <lkp@...el.com>
Subject: Re: [PATCH] usb: gadget: udc: renesas_usb3: Fix compiler warning
On Wed, Jan 22, 2025 at 12:59 PM Yoshihiro Shimoda
<yoshihiro.shimoda.uh@...esas.com> wrote:
>
> Hello,
>
> Thank you for the patch!
>
> > From: guoren@...nel.org, Sent: Wednesday, January 22, 2025 11:50 AM
> >
> > From: Guo Ren <guoren@...ux.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@...r.kernel.org
> > Reported-by: kernel test robot <lkp@...el.com>
> <snip URL>
> > Signed-off-by: Guo Ren <guoren@...ux.alibaba.com>
> > Signed-off-by: Guo Ren <guoren@...nel.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
Powered by blists - more mailing lists