[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <D0AC0465UQUJ.26171T9KETMCW@kernel.org>
Date: Wed, 03 Apr 2024 10:06:51 +0200
From: "Michael Walle" <mwalle@...nel.org>
To: "Christophe JAILLET" <christophe.jaillet@...adoo.fr>, "Vladimir Oltean"
<olteanv@...il.com>, "Andrew Lunn" <andrew@...n.ch>, "Florian Fainelli"
<f.fainelli@...il.com>, "David S. Miller" <davem@...emloft.net>, "Eric
Dumazet" <edumazet@...gle.com>, "Jakub Kicinski" <kuba@...nel.org>, "Paolo
Abeni" <pabeni@...hat.com>
Cc: <linux-kernel@...r.kernel.org>, <kernel-janitors@...r.kernel.org>,
<netdev@...r.kernel.org>
Subject: Re: [PATCH net] net: dsa: sja1105: Fix parameters order in
sja1110_pcs_mdio_write_c45()
On Tue Apr 2, 2024 at 8:33 PM CEST, Christophe JAILLET wrote:
> The definition and declaration of sja1110_pcs_mdio_write_c45() don't have
> parameters in the same order.
>
> Knowing that sja1110_pcs_mdio_write_c45() is used as a function pointer
> in 'sja1105_info' structure with .pcs_mdio_write_c45, and that we have:
>
> int (*pcs_mdio_write_c45)(struct mii_bus *bus, int phy, int mmd,
> int reg, u16 val);
>
> it is likely that the definition is the one to change.
See also "struct mii_bus":
/** @write_c45: Perform a C45 write transfer on the bus */
int (*write_c45)(struct mii_bus *bus, int addr, int devnum,
int regnum, u16 val);
>
> Found with cppcheck, funcArgOrderDifferent.
>
> Fixes: ae271547bba6 ("net: dsa: sja1105: C45 only transactions for PCS")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
> Compile tested only.
> ---
> drivers/net/dsa/sja1105/sja1105_mdio.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/dsa/sja1105/sja1105_mdio.c b/drivers/net/dsa/sja1105/sja1105_mdio.c
> index 833e55e4b961..52ddb4ef259e 100644
> --- a/drivers/net/dsa/sja1105/sja1105_mdio.c
> +++ b/drivers/net/dsa/sja1105/sja1105_mdio.c
> @@ -94,7 +94,7 @@ int sja1110_pcs_mdio_read_c45(struct mii_bus *bus, int phy, int mmd, int reg)
> return tmp & 0xffff;
> }
>
> -int sja1110_pcs_mdio_write_c45(struct mii_bus *bus, int phy, int reg, int mmd,
> +int sja1110_pcs_mdio_write_c45(struct mii_bus *bus, int phy, int mmd, int reg,
> u16 val)
Reviewed-by: Michael Walle <mwalle@...nel.org>
Vladimir, do you happen to know if some of your boards will use this
function? Just wondering because it was never noticed.
-michael
> {
> struct sja1105_mdio_private *mdio_priv = bus->priv;
Download attachment "signature.asc" of type "application/pgp-signature" (298 bytes)
Powered by blists - more mailing lists