From: David Miller <davem@davemloft.net>
To: arnd@arndb.de
Cc: isubramanian@apm.com, kchudgar@apm.com, tinamdar@apm.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: xgene: fix maybe-uninitialized variable
Date: Wed, 03 Aug 2016 11:52:32 -0700 (PDT) [thread overview]
Message-ID: <20160803.115232.837383021887790928.davem@davemloft.net> (raw)
In-Reply-To: <20160802102348.81986-1-arnd@arndb.de>
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.
prev parent reply other threads:[~2016-08-03 18:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-02 10:23 [PATCH] net: xgene: fix maybe-uninitialized variable Arnd Bergmann
2016-08-03 18:52 ` David Miller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160803.115232.837383021887790928.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=arnd@arndb.de \
--cc=isubramanian@apm.com \
--cc=kchudgar@apm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=tinamdar@apm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).