netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <simon.horman@corigine.com>
To: Jiawen Wu <jiawenwu@trustnetic.com>
Cc: netdev@vger.kernel.org, linux@armlinux.org.uk,
	linux-i2c@vger.kernel.org, linux-gpio@vger.kernel.org,
	mengyuanlou@net-swift.com
Subject: Re: [PATCH net-next v2 5/6] net: txgbe: Implement phylink pcs
Date: Tue, 11 Apr 2023 13:03:27 +0200	[thread overview]
Message-ID: <ZDU+f7aXvXcmSqnD@corigine.com> (raw)
In-Reply-To: <20230411092725.104992-6-jiawenwu@trustnetic.com>

On Tue, Apr 11, 2023 at 05:27:24PM +0800, Jiawen Wu wrote:
> Register MDIO bus for PCS layer, support 10GBASE-R and 1000BASE-X
> interfaces to the controller.

...

> diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c

...

> +static int txgbe_pcs_config(struct phylink_pcs *pcs, unsigned int mode,
> +			    phy_interface_t interface,
> +			    const unsigned long *advertising,
> +			    bool permit_pause_to_mac)
> +{
> +	struct txgbe *txgbe = container_of(pcs, struct txgbe, pcs);
> +	struct wx *wx = txgbe->wx;
> +	int ret, val;
> +
> +	if (interface == txgbe->interface)
> +		goto out;

Hi Jiawen,

The out label returns 'ret', but it is not initialised here.

Reported by clang-16 as:

drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c:270:6: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
        if (interface == txgbe->interface)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c:326:9: note: uninitialized use occurs here
        return ret;
               ^~~
drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c:270:2: note: remove the 'if' if its condition is always false
        if (interface == txgbe->interface)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c:268:9: note: initialize the variable 'ret' to silence this warning
        int ret, val;
               ^
                = 0
1 error generated.

...

  parent reply	other threads:[~2023-04-11 11:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-11  9:27 [PATCH net-next v2 0/6] TXGBE PHYLINK support Jiawen Wu
2023-04-11  9:27 ` [PATCH net-next v2 1/6] net: txgbe: Add software nodes to support phylink Jiawen Wu
2023-04-11 12:51   ` Andrew Lunn
2023-04-11  9:27 ` [PATCH net-next v2 2/6] net: txgbe: Implement I2C bus master driver Jiawen Wu
2023-04-11  9:32   ` Jiawen Wu
2023-04-11 10:08     ` Jarkko Nikula
2023-04-13 16:28       ` Wolfram Sang
2023-04-14 11:04         ` Jiawen Wu
2023-04-15 15:11           ` Andrew Lunn
2023-04-17  1:46             ` Jiawen Wu
2023-04-17  3:17           ` Jiawen Wu
2023-04-11  9:27 ` [PATCH net-next v2 3/6] net: txgbe: Add SFP module identify Jiawen Wu
2023-04-11 12:52   ` Andrew Lunn
2023-04-11  9:27 ` [PATCH net-next v2 4/6] net: txgbe: Support GPIO to SFP socket Jiawen Wu
2023-04-11  9:27 ` [PATCH net-next v2 5/6] net: txgbe: Implement phylink pcs Jiawen Wu
2023-04-11 10:36   ` Russell King (Oracle)
2023-04-11 11:03   ` Simon Horman [this message]
2023-04-17 14:47   ` kernel test robot
2023-04-11  9:27 ` [PATCH net-next v2 6/6] net: txgbe: Support phylink MAC layer Jiawen Wu
2023-04-11 10:44   ` Russell King (Oracle)
2023-04-11 12:43     ` Andrew Lunn

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=ZDU+f7aXvXcmSqnD@corigine.com \
    --to=simon.horman@corigine.com \
    --cc=jiawenwu@trustnetic.com \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mengyuanlou@net-swift.com \
    --cc=netdev@vger.kernel.org \
    /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).