Re: [PATCH] net: delete "<< 1U" cargo-culting
From: Alexey Dobriyan <hidden>
Date: 2023-07-19 11:29:10
On Tue, Jul 18, 2023 at 12:47:50PM +0200, Paolo Abeni wrote:
On Sat, 2023-07-15 at 13:19 +0300, Alexey Dobriyan wrote:quoted
6.5.7 §3 "Bitwise shift operators" clearly states that The type of the result is that of the promoted left operand All those integer constant suffixes in the right operand are pointless, delete them.Indeed. Still this patch is quite invasive and the net benefit looks quite marginal - if any at all.
I have all tree converted, this is just net/ part. Net(!) benefit is more readable code.
Older compiler could adhere to the standard less strictly or
No, no, no. Unless there is known miscompilation I don't buy this argument.
macro expansion - when the left '<<' operand is a macro argument - could be tricky.
But it is easy to verify that it doesn't. In theory someone could do __stringify(UDP_MAX_SEGMENTS) but what are the odds.
I think we are better of not applying this.