Skip to contentSkip to conversation

linux-next: build warning after merge of the phy-next tree

DISCUSSION Stephen Rothwell 3 participants 3 messages Nov 16, 2016 Linux-next tree

lore
Share & tools
lore
#0 lore raw

Hi Kishon,

After merging the phy-next tree, today's linux-next build (x86_64 allmodconfig) produced this warning:

drivers/phy/phy-rockchip-inno-usb2.c: In function 'rockchip_chg_detect_work':
drivers/phy/phy-rockchip-inno-usb2.c:717:7: warning: 'tmout' may be used uninitialized in this function [-Wmaybe-uninitialized]

    if (tmout) {
       ^

Introduced by commit

0c42fe48fd23 ("phy: rockchip-inno-usb2: support otg-port for rk3399")

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw

Hi Stephen,

Quoted 5 lines · Stephen Rothwell

Hi Kishon,

After merging the phy-next tree, today's linux-next build (x86_64 allmodconfig) produced this warning:

Quoted 8 lines

drivers/phy/phy-rockchip-inno-usb2.c: In function 'rockchip_chg_detect_work':
drivers/phy/phy-rockchip-inno-usb2.c:717:7: warning: 'tmout' may be used uninitialized in this function [-Wmaybe-uninitialized]

     if (tmout) {
        ^

Introduced by commit

   0c42fe48fd23 ("phy: rockchip-inno-usb2: support otg-port for rk3399")

The variable "tmout" is initialized in the prior code "case USB_CHG_STATE_WAIT_FOR_DCD", and this case will be executed before "if (tmout)", so I think it's a mis-warning for some special compiler.

Could you provide me some suggestion about this warning? Should I upload a new patch to fix this compiler mis-warning or just ignore it ? :-)

Best regards,
wulf

Quoted 1 line
#2 lore raw

Hi,

Quoted 17 lines · wlf

Hi Stephen,

Quoted 14 lines · Stephen Rothwell

Hi Kishon,

After merging the phy-next tree, today's linux-next build (x86_64 allmodconfig) produced this warning:

drivers/phy/phy-rockchip-inno-usb2.c: In function 'rockchip_chg_detect_work':
drivers/phy/phy-rockchip-inno-usb2.c:717:7: warning: 'tmout' may be used uninitialized in this function [-Wmaybe-uninitialized]

     if (tmout) {
        ^

Introduced by commit

   0c42fe48fd23 ("phy: rockchip-inno-usb2: support otg-port for rk3399")

Thank you for reporting this issue.

Quoted 9 lines

The variable "tmout" is initialized in the prior code "case USB_CHG_STATE_WAIT_FOR_DCD",
and this case will be executed before "if (tmout)", so I think it's a mis-warning for some
special compiler.

Could you provide me some suggestion about this warning? Should I upload a new patch to
fix this compiler mis-warning or just ignore it ? :-)

Arnd has already sent a fix it. I've picked that one.

Thanks
Kishon