summaryrefslogtreecommitdiffstats
path: root/scripts/asn1_compiler.c
diff options
context:
space:
mode:
authorDwaipayan Ray <dwaipayanray1@gmail.com>2020-12-15 20:44:36 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2020-12-15 22:46:17 -0800
commit7ebe1d173cae0778fa748ea3f2ae20dfa0f58e10 (patch)
tree5540b23c2d9f419fca3e99098d7c5f8bca98358f /scripts/asn1_compiler.c
parentdc58bc553e7a8e1d6eeaffd92cb8b346e0d62f70 (diff)
checkpatch: extend attributes check to handle more patterns
It is generally preferred that the macros from include/linux/compiler_attributes.h are used, unless there is a reason not to. checkpatch currently checks __attribute__ for each of packed, aligned, section, printf, scanf, and weak. Other declarations in compiler_attributes.h are not handled. Add a generic test to check the presence of such attributes. Some attributes require more specific handling and are kept separate. Also add fixes to the generic attributes check to substitute the correct conversions. New attributes which are now handled are: __always_inline__ __assume_aligned__(a, ## __VA_ARGS__) __cold__ __const__ __copy__(symbol) __designated_init__ __externally_visible__ __gnu_inline__ __malloc__ __mode__(x) __no_caller_saved_registers__ __noclone__ __noinline__ __nonstring__ __noreturn__ __pure__ __unused__ __used__ Declarations which contain multiple attributes like __attribute__((__packed__, __cold__)) are also handled except when proper conversions for one or more attributes of the list cannot be determined. Link: https://lore.kernel.org/linux-kernel-mentees/3ec15b41754b01666d94b76ce51b9832c2dd577a.camel@perches.com/ Link: https://lkml.kernel.org/r/20201025193103.23223-1-dwaipayanray1@gmail.com Signed-off-by: Dwaipayan Ray <dwaipayanray1@gmail.com> Suggested-by: Joe Perches <joe@perches.com> Acked-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/asn1_compiler.c')
0 files changed, 0 insertions, 0 deletions