Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1455973
| From | David Miller <davem@davemloft.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] net: xgene: fix maybe-uninitialized variable |
| Date | 2016-08-03 21:10 +0200 |
| Message-ID | <s29Id-6D8-13@gated-at.bofh.it> (permalink) |
| References | <s1F7r-36W-17@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Arnd Bergmann <arnd@arndb.de>
Date: Tue, 2 Aug 2016 12:23:29 +0200
> Building with -Wmaybe-uninitialized shows a potential use of
> an uninitialized variable:
>
> drivers/net/ethernet/apm/xgene/xgene_enet_hw.c: In function 'xgene_enet_phy_connect':
> drivers/net/ethernet/apm/xgene/xgene_enet_hw.c:802:23: warning: 'phy_dev' may be used uninitialized in this function [-Wmaybe-uninitialized]
>
> Although the compiler correctly identified this based on the function,
> the current code is still safe as long dev->of_node is non-NULL
> for the case of CONFIG_ACPI=n, which is currently the case.
>
> The warning is now disabled by default, but still appears when
> building with W=1, and other build test tools should be able to
> detect it as well. Adding an #else clause here makes the code
> more robust and makes it clear to the compiler that this cannot
> happen.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 8089a96f601b ("drivers: net: xgene: Add backward compatibility")
Applied.
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] net: xgene: fix maybe-uninitialized variable Arnd Bergmann <arnd@arndb.de> - 2016-08-02 12:30 +0200 Re: [PATCH] net: xgene: fix maybe-uninitialized variable David Miller <davem@davemloft.net> - 2016-08-03 21:10 +0200
csiph-web