> From: Thomas Monjalon [mailto:tho...@monjalon.net] > Sent: Tuesday, 19 November 2024 10.26 > > 15/11/2024 17:18, Stephen Hemminger: > > On Fri, 15 Nov 2024 07:25:30 -0800 > > Andre Muezerie <andre...@linux.microsoft.com> wrote: > > > > > From reading the code this is also a bugfix: > > > (1 << id), where id = thread_id & 0x3f, was wrong when thread_id > > 0x1f. > > > > Since this seems to be a common anti-pattern in DPDK, > > I wonder if coccinelle is smart enough to be able to make a script > for these? > > A simple grep '1UL << ' would do it as well.
Or more broadly: "\D1[uU]?[lL]?[lL]?\s*<<\s*" > We could add a checkpatch warning for this pattern. +1 And refer to RTE_BIT32/64() macros.