[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240304180523.GR403078@kernel.org>
Date: Mon, 4 Mar 2024 18:05:23 +0000
From: Simon Horman <horms@...nel.org>
To: Eric Woudstra <ericwouds@...il.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>, Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Frank Wunderlich <frank-w@...lic-files.de>,
Daniel Golle <daniel@...rotopia.org>,
Lucien Jheng <lucien.jheng@...oha.com>,
Zhi-Jun You <hujy652@...tonmail.com>, netdev@...r.kernel.org,
devicetree@...r.kernel.org
Subject: Re: [PATCH v2 net-next 2/2] net: phy: air_en8811h: Add the Airoha
EN8811H PHY driver
On Sat, Mar 02, 2024 at 07:38:35PM +0100, Eric Woudstra wrote:
...
> +static int air_led_init(struct phy_device *phydev, u8 index, u8 state, u8 pol)
> +{
> + int val;
> + int err;
> +
> + if (index >= EN8811H_LED_COUNT)
> + return -EINVAL;
Hi Eric,
I think val needs to be initialised before it is used below.
Flagged by clang-17 W=1 build.
> +
> + if (state == AIR_LED_ENABLE)
> + val |= AIR_PHY_LED_ON_ENABLE;
> + else
> + val &= ~AIR_PHY_LED_ON_ENABLE;
> +
> + if (pol == AIR_ACTIVE_HIGH)
> + val |= AIR_PHY_LED_ON_POLARITY;
> + else
> + val &= ~AIR_PHY_LED_ON_POLARITY;
> +
> + err = phy_modify_mmd(phydev, MDIO_MMD_VEND2, AIR_PHY_LED_ON(index),
> + AIR_PHY_LED_ON_ENABLE |
> + AIR_PHY_LED_ON_POLARITY, val);
> +
> + if (err < 0)
> + return err;
> +
> + return 0;
> +}
...
Powered by blists - more mailing lists