From: Andrew Lunn <andrew@lunn.ch>
To: trix@redhat.com
Cc: mlindner@marvell.com, stephen@networkplumber.org,
davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: sky2: initialize return of gm_phy_read
Date: Fri, 3 Jul 2020 15:53:10 +0200 [thread overview]
Message-ID: <20200703135310.GD807334@lunn.ch> (raw)
In-Reply-To: <20200703133359.22723-1-trix@redhat.com>
On Fri, Jul 03, 2020 at 06:33:59AM -0700, trix@redhat.com wrote:
> From: Tom Rix <trix@redhat.com>
>
> clang static analysis flags this garbage return
>
> drivers/net/ethernet/marvell/sky2.c:208:2: warning: Undefined or garbage value returned to caller [core.uninitialized.UndefReturn]
> return v;
> ^~~~~~~~
>
> static inline u16 gm_phy_read( ...
> {
> u16 v;
> __gm_phy_read(hw, port, reg, &v);
> return v;
> }
>
> __gm_phy_read can return without setting v.
>
> So handle similar to skge.c's gm_phy_read, initialize v.
>
> Signed-off-by: Tom Rix <trix@redhat.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
next prev parent reply other threads:[~2020-07-03 13:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-03 13:33 [PATCH] net: sky2: initialize return of gm_phy_read trix
2020-07-03 13:53 ` Andrew Lunn [this message]
2020-07-07 22:24 ` David Miller
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=20200703135310.GD807334@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mlindner@marvell.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
--cc=trix@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.