usb: gadget: udc: renesas_usb3: Fix compiler warning
Subsystems (3)
PATCH 1/1 usb: gadget: udc: renesas_usb3: Fix compiler warning
From: Guo Ren <[email protected]>
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);
^~~~~~~~~~~~~~~~~~~~~~~~ ^~ ^--- drivers/usb/gadget/udc/renesas_usb3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/gadget/udc/renesas_usb3.c +1 -1
@@ -310,7 +310,7 @@ struct renesas_usb3_request {struct list_head queue; }; -#define USB3_EP_NAME_SIZE 8 +#define USB3_EP_NAME_SIZE 16struct renesas_usb3_ep {struct usb_ep ep;struct renesas_usb3 *usb3;
Signature · 1 line
2.40.1
Hello,
Thank you for the patch!
Quoted 10 lines
From: [email protected], Sent: Wednesday, January 22, 2025 11:50 AM
From: Guo Ren <[email protected]>
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.
Quoted 1 line
Fixes 8292493c22c8 ("riscv: Kconfig.socs: Add ARCH_RENESAS kconfig option")
Please use the following Fixes tag:
Best regards,
Yoshihiro Shimoda
Quoted 2 lines
Reported-by kernel test robot <[email protected]>
<snip URL>
Quoted 22 lines
Signed-off-by Guo Ren <[email protected]>Signed-off-by Guo Ren <[email protected]>--- drivers/usb/gadget/udc/renesas_usb3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/gadget/udc/renesas_usb3.c +1
-2@@ -310,7 +310,7 @@ struct renesas_usb3_request {struct list_head queue; }; -#define USB3_EP_NAME_SIZE 8 +#define USB3_EP_NAME_SIZE 16struct renesas_usb3_ep {struct usb_ep ep;struct renesas_usb3 *usb3; --2.40.1
Quoted 16 lines · Yoshihiro Shimoda
Hello,
Thank you for the patch!
Quoted 10 lines
From: [email protected], Sent: Wednesday, January 22, 2025 11:50 AM
From: Guo Ren <[email protected]>
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); ^~~~~~~~~~~~~~~~~~~~~~~~ ^~ ^
Quoted 8 lines
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.
Quoted 1 line
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
Quoted 30 lines
Best regards,
Yoshihiro ShimodaQuoted 2 lines
Reported-by kernel test robot <[email protected]><snip URL>
Quoted 22 lines
Signed-off-by Guo Ren <[email protected]>Signed-off-by Guo Ren <[email protected]>--- drivers/usb/gadget/udc/renesas_usb3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/gadget/udc/renesas_usb3.c +1
-2@@ -310,7 +310,7 @@ struct renesas_usb3_request {struct list_head queue; }; -#define USB3_EP_NAME_SIZE 8 +#define USB3_EP_NAME_SIZE 16struct renesas_usb3_ep {struct usb_ep ep;struct renesas_usb3 *usb3; --2.40.1
Signature · 2 lines
Best Regards Guo Ren