aboutsummaryrefslogtreecommitdiff
path: root/scripts/gdb/linux/mm.py
diff options
context:
space:
mode:
authorAntonio Borneo <[email protected]>2022-06-13 12:00:55 +0200
committerakpm <[email protected]>2022-06-16 19:58:22 -0700
commitf858e23a29740757fe1ca602cb1f57845034b1c5 (patch)
tree1483ecc116c2b6cb0a80461e552a8d2ae94f600b /scripts/gdb/linux/mm.py
parentdd7c9be330d87732766a95cfd7a6de38bf7a39c3 (diff)
checkpatch: fix incorrect camelcase detection on numeric constant
The code fragment below int foo(int *array, int index) { return array[index & 0xFF]; } triggers an incorrect camelcase detection by checking a substring of the hex constant: CHECK: Avoid CamelCase: <xFF> #3: FILE: test.c:3: + return array[index & 0xFF]; This is caused by passing the whole string "array[index & 0xFF]" to the inner loop that iterates over a "$Ident" match. The numeric constant is not a $Ident as it doesn't start with [A-Za-z_] and should be excluded from the match. Similar issue can be detected with other constants like "1uL", "0xffffU". Force the match to start at word boundary so the $Ident will be properly checked starting from its first char and the constants will be filtered-out. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Antonio Borneo <[email protected]> Cc: Joe Perches <[email protected]> Cc: Andy Whitcroft <[email protected]> Cc: Dwaipayan Ray <[email protected]> Cc: Lukas Bulwahn <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/mm.py')
0 files changed, 0 insertions, 0 deletions