[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGb2v67xPoo-LQp9Z70yEBDXmgJTD=RvLP0tYYEXUJZr6B+Xkw@mail.gmail.com>
Date: Tue, 18 Feb 2025 20:29:02 +0800
From: Chen-Yu Tsai <wens@...e.org>
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>, "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 6:25 PM Russell King (Oracle)
<rmk+kernel@...linux.org.uk> 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>
> ---
> drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c | 2 +-
Acked-by: Chen-Yu Tsai <wens@...e.org>
Powered by blists - more mailing lists