Skip to content

Commit c5967e9

Browse files
JoePerchestorvalds
authored andcommitted
checkpatch: add __ro_after_init to known $Attribute
__ro_after_init is a specific __attribute__ that checkpatch does currently not understand. Add it to the known $Attribute types so that code that uses variables declared with __ro_after_init are not thought to be a modifier type. This appears as a defect in checkpatch output of code like: static bool trust_cpu __ro_after_init = IS_ENABLED(CONFIG_RANDOM_TRUST_CPU); [...] if (trust_cpu && arch_init) { where checkpatch reports: ERROR: space prohibited after that '&&' (ctx:WxW) if (trust_cpu && arch_init) { Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Joe Perches <[email protected]> Reported-by: Kees Cook <[email protected]> Tested-by: Kees Cook <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 62ec0d8 commit c5967e9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

scripts/checkpatch.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ sub hash_show_words {
380380
__noclone|
381381
__deprecated|
382382
__read_mostly|
383+
__ro_after_init|
383384
__kprobes|
384385
$InitAttribute|
385386
____cacheline_aligned|

0 commit comments

Comments
 (0)