[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250925085217.GX836419@horms.kernel.org>
Date: Thu, 25 Sep 2025 09:52:17 +0100
From: Simon Horman <horms@...nel.org>
To: Théo Lebrun <theo.lebrun@...tlin.com>
Cc: Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Nicolas Ferre <nicolas.ferre@...rochip.com>,
Claudiu Beznea <claudiu.beznea@...on.dev>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Harini Katakam <harini.katakam@...inx.com>,
Richard Cochran <richardcochran@...il.com>,
Russell King <linux@...linux.org.uk>, netdev@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Tawfik Bayouk <tawfik.bayouk@...ileye.com>,
Sean Anderson <sean.anderson@...ux.dev>
Subject: Re: [PATCH net v6 5/5] net: macb: avoid dealing with endianness in
macb_set_hwaddr()
On Tue, Sep 23, 2025 at 06:00:27PM +0200, Théo Lebrun wrote:
> bp->dev->dev_addr is of type `unsigned char *`. Casting it to a u32
> pointer and dereferencing implies dealing manually with endianness,
> which is error-prone.
>
> Replace by calls to get_unaligned_le32|le16() helpers.
>
> This was found using sparse:
> ⟩ make C=2 drivers/net/ethernet/cadence/macb_main.o
> warning: incorrect type in assignment (different base types)
> expected unsigned int [usertype] bottom
> got restricted __le32 [usertype]
> warning: incorrect type in assignment (different base types)
> expected unsigned short [usertype] top
> got restricted __le16 [usertype]
> ...
>
> Reviewed-by: Sean Anderson <sean.anderson@...ux.dev>
> Signed-off-by: Théo Lebrun <theo.lebrun@...tlin.com>
Reviewed-by: Simon Horman <horms@...nel.org>
Powered by blists - more mailing lists