summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2023-09-03 12:11:06 +0200
committerVinod Koul <vkoul@kernel.org>2023-10-13 15:34:39 +0530
commit9e34abc7abfac781df909891c8d53781f607105d (patch)
treed56b75a93aecac0fe875f305ad332cc63c96f16b
parent9bcf8761190fe87808bcd2aef96c8378088731fc (diff)
downloadlwn-9e34abc7abfac781df909891c8d53781f607105d.tar.gz
lwn-9e34abc7abfac781df909891c8d53781f607105d.zip
phy: sun4i-usb: update array size
With gcc 12.3.0, when this file is built, we get errors such as: drivers/phy/allwinner/phy-sun4i-usb.c: In function ‘sun4i_usb_phy_probe’: drivers/phy/allwinner/phy-sun4i-usb.c:790:52: error: ‘_vbus’ directive output may be truncated writing 5 bytes into a region of size between 2 and 12 [-Werror=format-truncation=] 790 | snprintf(name, sizeof(name), "usb%d_vbus", i); | ^~~~~ drivers/phy/allwinner/phy-sun4i-usb.c:790:17: note: ‘snprintf’ output between 10 and 20 bytes into a destination of size 16 790 | snprintf(name, sizeof(name), "usb%d_vbus", i); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Because of the possible value of 'i', this can't be an issue in real world application, but in order to have "make W=1" work correctly, give more space for 'name'. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com> Link: https://lore.kernel.org/r/0bc81612171baaa6d5dff58c8e009debc03e1ba8.1693735840.git.christophe.jaillet@wanadoo.fr [vkoul: updated patch title] Signed-off-by: Vinod Koul <vkoul@kernel.org>
-rw-r--r--drivers/phy/allwinner/phy-sun4i-usb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c
index ec551464dd4f..e53a9a9317bc 100644
--- a/drivers/phy/allwinner/phy-sun4i-usb.c
+++ b/drivers/phy/allwinner/phy-sun4i-usb.c
@@ -782,7 +782,7 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev)
for (i = 0; i < data->cfg->num_phys; i++) {
struct sun4i_usb_phy *phy = data->phys + i;
- char name[16];
+ char name[32];
if (data->cfg->missing_phys & BIT(i))
continue;