From: Simon Horman <horms@kernel.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Oleksij Rempel <o.rempel@pengutronix.de>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
Woojung Huh <woojung.huh@microchip.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Russell King <rmk+kernel@armlinux.org.uk>,
Thangaraj Samynathan <Thangaraj.S@microchip.com>,
Rengarajan Sundararajan <Rengarajan.S@microchip.com>,
kernel@pengutronix.de, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, UNGLinuxDriver@microchip.com,
Phil Elwell <phil@raspberrypi.org>,
Maxime Chevallier <maxime.chevallier@bootlin.com>
Subject: Re: [PATCH net-next v1 1/1] net: usb: lan78xx: annotate checksum assignment to silence sparse warnings
Date: Tue, 24 Jun 2025 11:47:35 +0100 [thread overview]
Message-ID: <20250624104735.GD8266@horms.kernel.org> (raw)
In-Reply-To: <20250623164913.474be2b3@kernel.org>
On Mon, Jun 23, 2025 at 04:49:13PM -0700, Jakub Kicinski wrote:
> On Fri, 20 Jun 2025 10:46:18 +0200 Oleksij Rempel wrote:
> > - skb->csum = ntohs((u16)(rx_cmd_b >> RX_CMD_B_CSUM_SHIFT_));
> > + __be16 csum_raw;
> > +
> > + csum_raw = (__force __be16)(rx_cmd_b >> RX_CMD_B_CSUM_SHIFT_);
> > + skb->csum = (__force __wsum)ntohs(csum_raw);
>
> You can avoid the __force __be16 if you switch the variable to be u16
> and then htons instead of ntohs
Ok, now I am confused.
What is the endian of these integers?
prev parent reply other threads:[~2025-06-24 10:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-20 8:46 [PATCH net-next v1 1/1] net: usb: lan78xx: annotate checksum assignment to silence sparse warnings Oleksij Rempel
2025-06-23 23:49 ` Jakub Kicinski
2025-06-24 10:47 ` Simon Horman [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=20250624104735.GD8266@horms.kernel.org \
--to=horms@kernel.org \
--cc=Rengarajan.S@microchip.com \
--cc=Thangaraj.S@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.chevallier@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=pabeni@redhat.com \
--cc=phil@raspberrypi.org \
--cc=rmk+kernel@armlinux.org.uk \
--cc=woojung.huh@microchip.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).