RE: [PATCH net] lib: packing: fix shift wrapping in bit_reverse()

From
David Laight <hidden>
Date
2022-12-07 19:41:37
Also in
kernel-janitors
Reply to
Dan Carpenter, 2022-12-07
From: Dan Carpenter
Sent: 07 December 2022 12:21
....
quoted
quoted
-		new_val |= (bit << (width - i - 1));
+		if (val & BIT_ULL(1))
hmm, why 1 and not i?
Because I'm a moron.  Let me resend.
Since we're not writing FORTRAN-IV why not use a variable
name that is harder to confuse with 1?

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Thread (17 messages) 17 messages, 5 authors, last reply 2022-12-12
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help