From: "Théo Lebrun" <theo.lebrun@bootlin.com>
To: "Karumanchi, Vineeth" <vineeth@amd.com>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Nicolas Ferre" <nicolas.ferre@microchip.com>,
"Claudiu Beznea" <claudiu.beznea@tuxon.dev>,
"Geert Uytterhoeven" <geert@linux-m68k.org>,
"Harini Katakam" <harini.katakam@xilinx.com>,
"Richard Cochran" <richardcochran@gmail.com>,
"Russell King" <linux@armlinux.org.uk>
Cc: <netdev@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
"Tawfik Bayouk" <tawfik.bayouk@mobileye.com>,
"Sean Anderson" <sean.anderson@linux.dev>
Subject: Re: [PATCH net v5 5/5] net: macb: avoid dealing with endianness in macb_set_hwaddr()
Date: Thu, 11 Sep 2025 11:22:47 +0200 [thread overview]
Message-ID: <DCPV0SVDR2J7.2FKMD5PD9S235@bootlin.com> (raw)
In-Reply-To: <17d518ca-d35a-4279-b4fe-6930c5e279cd@amd.com>
On Thu Sep 11, 2025 at 5:13 AM CEST, Karumanchi, Vineeth wrote:
> On 9/10/2025 9:45 PM, Théo Lebrun wrote:
>> @@ -271,12 +271,10 @@ static bool hw_is_gem(void __iomem *addr, bool native_io)
>>
>> static void macb_set_hwaddr(struct macb *bp)
>> {
>> - u32 bottom;
>> - u16 top;
>> + u32 bottom = get_unaligned_le32(bp->dev->dev_addr);
>> + u16 top = get_unaligned_le16(bp->dev->dev_addr + 4);
>
> please change the order as per reverse xmas tree.
I had realised this before sending the patch but preferred keeping the
ordering as-is to access dev_addr+0 first then dev_addr+4.
RCT is a strict rule in net so I'll fix it in the next revision. Some
sneaky options were also considered: a spare space in the `u32 bottom`
line, express bottom using `dev_addr + 0`, or renaming variables. :-)
Thanks Vineeth,
--
Théo Lebrun, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
prev parent reply other threads:[~2025-09-11 9:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-10 16:15 [PATCH net v5 0/5] net: macb: various fixes Théo Lebrun
2025-09-10 16:15 ` [PATCH net v5 1/5] dt-bindings: net: cdns,macb: allow tsu_clk without tx_clk Théo Lebrun
2025-09-10 16:15 ` [PATCH net v5 2/5] net: macb: remove illusion about TBQPH/RBQPH being per-queue Théo Lebrun
2025-09-10 16:15 ` [PATCH net v5 3/5] net: macb: move ring size computation to functions Théo Lebrun
2025-09-11 6:43 ` Karumanchi, Vineeth
2025-09-11 9:14 ` Théo Lebrun
2025-09-11 23:39 ` Jakub Kicinski
2025-09-10 16:15 ` [PATCH net v5 4/5] net: macb: single dma_alloc_coherent() for DMA descriptors Théo Lebrun
2025-09-10 16:15 ` [PATCH net v5 5/5] net: macb: avoid dealing with endianness in macb_set_hwaddr() Théo Lebrun
2025-09-11 3:13 ` Karumanchi, Vineeth
2025-09-11 9:22 ` Théo Lebrun [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DCPV0SVDR2J7.2FKMD5PD9S235@bootlin.com \
--to=theo.lebrun@bootlin.com \
--cc=andrew+netdev@lunn.ch \
--cc=claudiu.beznea@tuxon.dev \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=geert@linux-m68k.org \
--cc=harini.katakam@xilinx.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=robh@kernel.org \
--cc=sean.anderson@linux.dev \
--cc=tawfik.bayouk@mobileye.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=vineeth@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.