lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250623164913.474be2b3@kernel.org>
Date: Mon, 23 Jun 2025 16:49:13 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Oleksij Rempel <o.rempel@...gutronix.de>
Cc: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
 <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>, Woojung Huh
 <woojung.huh@...rochip.com>, Andrew Lunn <andrew+netdev@...n.ch>, Russell
 King <rmk+kernel@...linux.org.uk>, Thangaraj Samynathan
 <Thangaraj.S@...rochip.com>, Rengarajan Sundararajan
 <Rengarajan.S@...rochip.com>, kernel@...gutronix.de,
 linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
 UNGLinuxDriver@...rochip.com, Phil Elwell <phil@...pberrypi.org>, Maxime
 Chevallier <maxime.chevallier@...tlin.com>, Simon Horman <horms@...nel.org>
Subject: Re: [PATCH net-next v1 1/1] net: usb: lan78xx: annotate checksum
 assignment to silence sparse warnings

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
-- 
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ