[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1651981c-f0ed-49b0-9424-41580eb8b150@lunn.ch>
Date: Tue, 18 Feb 2025 17:04:24 +0100
From: Andrew Lunn <andrew@...n.ch>
To: "Russell King (Oracle)" <rmk+kernel@...linux.org.uk>
Cc: netdev@...r.kernel.org, Alexandre Torgue <alexandre.torgue@...s.st.com>,
Andrew Lunn <andrew+netdev@...n.ch>, Chen-Yu Tsai <wens@...e.org>,
"David S. Miller" <davem@...emloft.net>,
Drew Fustini <drew@...7.com>,
Emil Renner Berthing <kernel@...il.dk>,
Eric Dumazet <edumazet@...gle.com>,
Fabio Estevam <festevam@...il.com>, Fu Wei <wefu@...hat.com>,
Guo Ren <guoren@...nel.org>, imx@...ts.linux.dev,
Jakub Kicinski <kuba@...nel.org>,
Jan Petrous <jan.petrous@....nxp.com>,
Jernej Skrabec <jernej.skrabec@...il.com>,
Jerome Brunet <jbrunet@...libre.com>,
Kevin Hilman <khilman@...libre.com>,
linux-amlogic@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, linux-arm-msm@...r.kernel.org,
linux-riscv@...ts.infradead.org,
linux-stm32@...md-mailman.stormreply.com,
linux-sunxi@...ts.linux.dev,
Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Minda Chen <minda.chen@...rfivetech.com>,
Neil Armstrong <neil.armstrong@...aro.org>,
Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@...hiba.co.jp>,
NXP S32 Linux Team <s32@....com>, Paolo Abeni <pabeni@...hat.com>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Samuel Holland <samuel@...lland.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Shawn Guo <shawnguo@...nel.org>, Vinod Koul <vkoul@...nel.org>
Subject: Re: [PATCH net-next 3/3] net: stmmac: "speed" passed to
fix_mac_speed is an int
On Tue, Feb 18, 2025 at 10:24:39AM +0000, Russell King (Oracle) wrote:
> priv->plat->fix_mac_speed() is called from stmmac_mac_link_up(), which
> is passed the speed as an "int". However, fix_mac_speed() implicitly
> casts this to an unsigned int. Some platform glue code print this value
> using %u, others with %d. Some implicitly cast it back to an int, and
> others to u32.
>
> Good practice is to use one type and only one type to represent a value
> being passed around a driver.
>
> Switch all of these over to consistently use "int" when dealing with a
> speed passed from stmmac_mac_link_up(), even though the speed will
> always be positive.
>
> Signed-off-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
Reviewed-by: Andrew Lunn <andrew@...n.ch>
Andrew
Powered by blists - more mailing lists