Re: [PATCH net-next] llc: avoid sparse cast-truncates warning in counter clamps
From: patchwork-bot+netdevbpf
Date: Fri May 15 2026 - 21:00:15 EST
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@xxxxxxxxxx>:
On Wed, 13 May 2026 14:52:53 +0530 you wrote:
> llc_conn_ac_inc_npta_value() and llc_conn_ac_inc_tx_win_size()
> clamp their counters to the maximum valid 7-bit value via
> (u8) ~LLC_2_SEQ_NBR_MODULO. LLC_2_SEQ_NBR_MODULO is defined as
> ((u8) 128) in include/net/llc_pdu.h, but the (u8) cast does not
> prevent integer promotion of the operand of ~: ~128 is computed
> as int (0xffffff7f), and the surrounding (u8) cast truncates
> back to 0x7f. The result is correct (127), but the implicit
> truncation is flagged by sparse:
>
> [...]
Here is the summary with links:
- [net-next] llc: avoid sparse cast-truncates warning in counter clamps
https://git.kernel.org/netdev/net-next/c/3931012141aa
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html