ERROR: Macros with complex values should be enclosed in parentheses #28: FILE: include/linux/btf_ids.h:43: +#define ____BTF_ID(symbol, word, sec) \ asm( \ +".pushsection " sec ",\"a\"; \n" \ ".local " #symbol " ; \n" \ ".type " #symbol ", STT_OBJECT; \n" \ ".size " #symbol ", 4; \n" \ BUT SEE: do {} while (0) advice is over-stated in a few situations: The more obvious case is macros, like MODULE_PARM_DESC, invoked at file-scope, where C disallows code (it must be in functions). See $exceptions if you have one to add by name. More troublesome is declarative macros used at top of new scope, like DECLARE_PER_CPU. These might just compile with a do-while-0 wrapper, but would be incorrect. Most of these are handled by detecting struct,union,etc declaration primitives in $exceptions. Theres also macros called inside an if (block), which "return" an expression. These cannot do-while, and need a ({}) wrapper. Enjoy this qualification while we work to improve our heuristics. WARNING: Argument 'word' is not used in function-like macro #28: FILE: include/linux/btf_ids.h:43: +#define ____BTF_ID(symbol, word, sec) \ asm( \ +".pushsection " sec ",\"a\"; \n" \ ".local " #symbol " ; \n" \ ".type " #symbol ", STT_OBJECT; \n" \ ".size " #symbol ", 4; \n" \ WARNING: unnecessary whitespace before a quoted newline #31: FILE: include/linux/btf_ids.h:45: +".pushsection " sec ",\"a\"; \n" \ WARNING: macros should not use a trailing semicolon #49: FILE: include/linux/btf_ids.h:89: +#define __BTF_ID_LIST(name, scope, sec) \ asm( \ +".pushsection " sec ",\"a\"; \n" \ "." #scope " " #name "; \n" \ #name ":; \n" \ ".popsection; \n"); WARNING: unnecessary whitespace before a quoted newline #52: FILE: include/linux/btf_ids.h:91: +".pushsection " sec ",\"a\"; \n" \ WARNING: line length of 84 exceeds 80 columns #92: FILE: include/linux/btf_ids.h:177: + * end is linker symbol __BTF_ids_seg_end_ (see btf_ids.lds.h). resolve_btfids WARNING: line length of 82 exceeds 80 columns #95: FILE: include/linux/btf_ids.h:180: + * extern struct btf_id_set name is emitted by BTF_SET_SUB. BTF_ID_SUB(name, ...) WARNING: line length of 83 exceeds 80 columns #100: FILE: include/linux/btf_ids.h:185: +/* Indirection so __ID() expands before ____BTF_ID() stringifies its symbol arg. */ WARNING: line length of 83 exceeds 80 columns #104: FILE: include/linux/btf_ids.h:189: + __BTF_ID_SUB(__ID(__BTF_ID__##prefix##__##name##__), __BTF_IDS_SUBSEC(sub)) WARNING: macros should not use a trailing semicolon #109: FILE: include/linux/btf_ids.h:194: +#define __BTF_SET_SUB(name, scope) \ +asm( \ +".pushsection " __BTF_IDS_SUBSEC(name) ",\"a\"; \n" \ +"." #scope " __BTF_ID__setsc__" #name "; \n" \ +"__BTF_ID__setsc__" #name ":; \n" \ +".zero 4 \n" \ +".popsection; \n"); WARNING: unnecessary whitespace before a quoted newline #111: FILE: include/linux/btf_ids.h:196: +".pushsection " __BTF_IDS_SUBSEC(name) ",\"a\"; \n" \ WARNING: unnecessary whitespace before a quoted newline #112: FILE: include/linux/btf_ids.h:197: +"." #scope " __BTF_ID__setsc__" #name "; \n" \ WARNING: unnecessary whitespace before a quoted newline #113: FILE: include/linux/btf_ids.h:198: +"__BTF_ID__setsc__" #name ":; \n" \ WARNING: unnecessary whitespace before a quoted newline #114: FILE: include/linux/btf_ids.h:199: +".zero 4 \n" \ WARNING: unnecessary whitespace before a quoted newline #115: FILE: include/linux/btf_ids.h:200: +".popsection; \n"); WARNING: line length of 91 exceeds 80 columns #127: FILE: include/linux/btf_ids.h:212: +/* Cascade: emit first subsection, recurse on the rest (same kfunc @name). Up to 6 subs. */ ERROR: Macros with complex values should be enclosed in parentheses #131: FILE: include/linux/btf_ids.h:216: +#define __BPF_VERIF_KFUNC_DEF_2(name, s1, s2) \ + BTF_ID_SUB(__BPF_VERIF_KFUNC_SUB(s1), func, name) \ + __BPF_VERIF_KFUNC_DEF_1(name, s2) BUT SEE: do {} while (0) advice is over-stated in a few situations: The more obvious case is macros, like MODULE_PARM_DESC, invoked at file-scope, where C disallows code (it must be in functions). See $exceptions if you have one to add by name. More troublesome is declarative macros used at top of new scope, like DECLARE_PER_CPU. These might just compile with a do-while-0 wrapper, but would be incorrect. Most of these are handled by detecting struct,union,etc declaration primitives in $exceptions. Theres also macros called inside an if (block), which "return" an expression. These cannot do-while, and need a ({}) wrapper. Enjoy this qualification while we work to improve our heuristics. ERROR: Macros with complex values should be enclosed in parentheses #135: FILE: include/linux/btf_ids.h:220: +#define __BPF_VERIF_KFUNC_DEF_3(name, s1, s2, s3) \ + BTF_ID_SUB(__BPF_VERIF_KFUNC_SUB(s1), func, name) \ + __BPF_VERIF_KFUNC_DEF_2(name, s2, s3) BUT SEE: do {} while (0) advice is over-stated in a few situations: The more obvious case is macros, like MODULE_PARM_DESC, invoked at file-scope, where C disallows code (it must be in functions). See $exceptions if you have one to add by name. More troublesome is declarative macros used at top of new scope, like DECLARE_PER_CPU. These might just compile with a do-while-0 wrapper, but would be incorrect. Most of these are handled by detecting struct,union,etc declaration primitives in $exceptions. Theres also macros called inside an if (block), which "return" an expression. These cannot do-while, and need a ({}) wrapper. Enjoy this qualification while we work to improve our heuristics. ERROR: Macros with complex values should be enclosed in parentheses #139: FILE: include/linux/btf_ids.h:224: +#define __BPF_VERIF_KFUNC_DEF_4(name, s1, s2, s3, s4) \ + BTF_ID_SUB(__BPF_VERIF_KFUNC_SUB(s1), func, name) \ + __BPF_VERIF_KFUNC_DEF_3(name, s2, s3, s4) BUT SEE: do {} while (0) advice is over-stated in a few situations: The more obvious case is macros, like MODULE_PARM_DESC, invoked at file-scope, where C disallows code (it must be in functions). See $exceptions if you have one to add by name. More troublesome is declarative macros used at top of new scope, like DECLARE_PER_CPU. These might just compile with a do-while-0 wrapper, but would be incorrect. Most of these are handled by detecting struct,union,etc declaration primitives in $exceptions. Theres also macros called inside an if (block), which "return" an expression. These cannot do-while, and need a ({}) wrapper. Enjoy this qualification while we work to improve our heuristics. ERROR: Macros with complex values should be enclosed in parentheses #143: FILE: include/linux/btf_ids.h:228: +#define __BPF_VERIF_KFUNC_DEF_5(name, s1, s2, s3, s4, s5) \ + BTF_ID_SUB(__BPF_VERIF_KFUNC_SUB(s1), func, name) \ + __BPF_VERIF_KFUNC_DEF_4(name, s2, s3, s4, s5) BUT SEE: do {} while (0) advice is over-stated in a few situations: The more obvious case is macros, like MODULE_PARM_DESC, invoked at file-scope, where C disallows code (it must be in functions). See $exceptions if you have one to add by name. More troublesome is declarative macros used at top of new scope, like DECLARE_PER_CPU. These might just compile with a do-while-0 wrapper, but would be incorrect. Most of these are handled by detecting struct,union,etc declaration primitives in $exceptions. Theres also macros called inside an if (block), which "return" an expression. These cannot do-while, and need a ({}) wrapper. Enjoy this qualification while we work to improve our heuristics. ERROR: Macros with complex values should be enclosed in parentheses #147: FILE: include/linux/btf_ids.h:232: +#define __BPF_VERIF_KFUNC_DEF_6(name, s1, s2, s3, s4, s5, s6) \ + BTF_ID_SUB(__BPF_VERIF_KFUNC_SUB(s1), func, name) \ + __BPF_VERIF_KFUNC_DEF_5(name, s2, s3, s4, s5, s6) BUT SEE: do {} while (0) advice is over-stated in a few situations: The more obvious case is macros, like MODULE_PARM_DESC, invoked at file-scope, where C disallows code (it must be in functions). See $exceptions if you have one to add by name. More troublesome is declarative macros used at top of new scope, like DECLARE_PER_CPU. These might just compile with a do-while-0 wrapper, but would be incorrect. Most of these are handled by detecting struct,union,etc declaration primitives in $exceptions. Theres also macros called inside an if (block), which "return" an expression. These cannot do-while, and need a ({}) wrapper. Enjoy this qualification while we work to improve our heuristics. WARNING: line length of 91 exceeds 80 columns #151: FILE: include/linux/btf_ids.h:236: +/* First arg: kfunc symbol; rest: subsection suffix tokens matching bpf_verif_kfunc_. */ WARNING: line length of 87 exceeds 80 columns #153: FILE: include/linux/btf_ids.h:238: + CONCATENATE(__BPF_VERIF_KFUNC_DEF_, COUNT_ARGS(__VA_ARGS__))(name, __VA_ARGS__) WARNING: macros should not use a trailing semicolon #171: FILE: include/linux/btf_ids.h:299: +#define BTF_SET_SUB(name) static struct btf_id_set __maybe_unused name = { 0 }; ERROR: Macros with complex values should be enclosed in parentheses #186: FILE: tools/include/linux/btf_ids.h:38: +#define ____BTF_ID(symbol, sec) \ asm( \ +".pushsection " sec ",\"a\"; \n" \ ".local " #symbol " ; \n" \ ".type " #symbol ", STT_OBJECT; \n" \ ".size " #symbol ", 4; \n" \ BUT SEE: do {} while (0) advice is over-stated in a few situations: The more obvious case is macros, like MODULE_PARM_DESC, invoked at file-scope, where C disallows code (it must be in functions). See $exceptions if you have one to add by name. More troublesome is declarative macros used at top of new scope, like DECLARE_PER_CPU. These might just compile with a do-while-0 wrapper, but would be incorrect. Most of these are handled by detecting struct,union,etc declaration primitives in $exceptions. Theres also macros called inside an if (block), which "return" an expression. These cannot do-while, and need a ({}) wrapper. Enjoy this qualification while we work to improve our heuristics. WARNING: unnecessary whitespace before a quoted newline #189: FILE: tools/include/linux/btf_ids.h:40: +".pushsection " sec ",\"a\"; \n" \ WARNING: macros should not use a trailing semicolon #207: FILE: tools/include/linux/btf_ids.h:76: +#define __BTF_ID_LIST(name, scope, sec) \ asm( \ +".pushsection " sec ",\"a\"; \n" \ "." #scope " " #name "; \n" \ #name ":; \n" \ ".popsection; \n"); WARNING: unnecessary whitespace before a quoted newline #210: FILE: tools/include/linux/btf_ids.h:78: +".pushsection " sec ",\"a\"; \n" \ WARNING: line length of 82 exceeds 80 columns #246: FILE: tools/include/linux/btf_ids.h:160: + * btf_ids.lds.h; begin is __BTF_ID__setsc__. extern struct btf_id_set name WARNING: line length of 83 exceeds 80 columns #251: FILE: tools/include/linux/btf_ids.h:165: +/* Indirection so __ID() expands before ____BTF_ID() stringifies its symbol arg. */ WARNING: line length of 83 exceeds 80 columns #255: FILE: tools/include/linux/btf_ids.h:169: + __BTF_ID_SUB(__ID(__BTF_ID__##prefix##__##name##__), __BTF_IDS_SUBSEC(sub)) WARNING: macros should not use a trailing semicolon #260: FILE: tools/include/linux/btf_ids.h:174: +#define __BTF_SET_SUB(name, scope) \ +asm( \ +".pushsection " __BTF_IDS_SUBSEC(name) ",\"a\"; \n" \ +"." #scope " __BTF_ID__setsc__" #name "; \n" \ +"__BTF_ID__setsc__" #name ":; \n" \ +".zero 4 \n" \ +".popsection; \n"); WARNING: unnecessary whitespace before a quoted newline #262: FILE: tools/include/linux/btf_ids.h:176: +".pushsection " __BTF_IDS_SUBSEC(name) ",\"a\"; \n" \ WARNING: unnecessary whitespace before a quoted newline #263: FILE: tools/include/linux/btf_ids.h:177: +"." #scope " __BTF_ID__setsc__" #name "; \n" \ WARNING: unnecessary whitespace before a quoted newline #264: FILE: tools/include/linux/btf_ids.h:178: +"__BTF_ID__setsc__" #name ":; \n" \ WARNING: unnecessary whitespace before a quoted newline #265: FILE: tools/include/linux/btf_ids.h:179: +".zero 4 \n" \ WARNING: unnecessary whitespace before a quoted newline #266: FILE: tools/include/linux/btf_ids.h:180: +".popsection; \n"); WARNING: line length of 91 exceeds 80 columns #278: FILE: tools/include/linux/btf_ids.h:192: +/* Cascade: emit first subsection, recurse on the rest (same kfunc @name). Up to 6 subs. */ ERROR: Macros with complex values should be enclosed in parentheses #282: FILE: tools/include/linux/btf_ids.h:196: +#define __BPF_VERIF_KFUNC_DEF_2(name, s1, s2) \ + BTF_ID_SUB(__BPF_VERIF_KFUNC_SUB(s1), func, name) \ + __BPF_VERIF_KFUNC_DEF_1(name, s2) BUT SEE: do {} while (0) advice is over-stated in a few situations: The more obvious case is macros, like MODULE_PARM_DESC, invoked at file-scope, where C disallows code (it must be in functions). See $exceptions if you have one to add by name. More troublesome is declarative macros used at top of new scope, like DECLARE_PER_CPU. These might just compile with a do-while-0 wrapper, but would be incorrect. Most of these are handled by detecting struct,union,etc declaration primitives in $exceptions. Theres also macros called inside an if (block), which "return" an expression. These cannot do-while, and need a ({}) wrapper. Enjoy this qualification while we work to improve our heuristics. ERROR: Macros with complex values should be enclosed in parentheses #286: FILE: tools/include/linux/btf_ids.h:200: +#define __BPF_VERIF_KFUNC_DEF_3(name, s1, s2, s3) \ + BTF_ID_SUB(__BPF_VERIF_KFUNC_SUB(s1), func, name) \ + __BPF_VERIF_KFUNC_DEF_2(name, s2, s3) BUT SEE: do {} while (0) advice is over-stated in a few situations: The more obvious case is macros, like MODULE_PARM_DESC, invoked at file-scope, where C disallows code (it must be in functions). See $exceptions if you have one to add by name. More troublesome is declarative macros used at top of new scope, like DECLARE_PER_CPU. These might just compile with a do-while-0 wrapper, but would be incorrect. Most of these are handled by detecting struct,union,etc declaration primitives in $exceptions. Theres also macros called inside an if (block), which "return" an expression. These cannot do-while, and need a ({}) wrapper. Enjoy this qualification while we work to improve our heuristics. ERROR: Macros with complex values should be enclosed in parentheses #290: FILE: tools/include/linux/btf_ids.h:204: +#define __BPF_VERIF_KFUNC_DEF_4(name, s1, s2, s3, s4) \ + BTF_ID_SUB(__BPF_VERIF_KFUNC_SUB(s1), func, name) \ + __BPF_VERIF_KFUNC_DEF_3(name, s2, s3, s4) BUT SEE: do {} while (0) advice is over-stated in a few situations: The more obvious case is macros, like MODULE_PARM_DESC, invoked at file-scope, where C disallows code (it must be in functions). See $exceptions if you have one to add by name. More troublesome is declarative macros used at top of new scope, like DECLARE_PER_CPU. These might just compile with a do-while-0 wrapper, but would be incorrect. Most of these are handled by detecting struct,union,etc declaration primitives in $exceptions. Theres also macros called inside an if (block), which "return" an expression. These cannot do-while, and need a ({}) wrapper. Enjoy this qualification while we work to improve our heuristics. ERROR: Macros with complex values should be enclosed in parentheses #294: FILE: tools/include/linux/btf_ids.h:208: +#define __BPF_VERIF_KFUNC_DEF_5(name, s1, s2, s3, s4, s5) \ + BTF_ID_SUB(__BPF_VERIF_KFUNC_SUB(s1), func, name) \ + __BPF_VERIF_KFUNC_DEF_4(name, s2, s3, s4, s5) BUT SEE: do {} while (0) advice is over-stated in a few situations: The more obvious case is macros, like MODULE_PARM_DESC, invoked at file-scope, where C disallows code (it must be in functions). See $exceptions if you have one to add by name. More troublesome is declarative macros used at top of new scope, like DECLARE_PER_CPU. These might just compile with a do-while-0 wrapper, but would be incorrect. Most of these are handled by detecting struct,union,etc declaration primitives in $exceptions. Theres also macros called inside an if (block), which "return" an expression. These cannot do-while, and need a ({}) wrapper. Enjoy this qualification while we work to improve our heuristics. ERROR: Macros with complex values should be enclosed in parentheses #298: FILE: tools/include/linux/btf_ids.h:212: +#define __BPF_VERIF_KFUNC_DEF_6(name, s1, s2, s3, s4, s5, s6) \ + BTF_ID_SUB(__BPF_VERIF_KFUNC_SUB(s1), func, name) \ + __BPF_VERIF_KFUNC_DEF_5(name, s2, s3, s4, s5, s6) BUT SEE: do {} while (0) advice is over-stated in a few situations: The more obvious case is macros, like MODULE_PARM_DESC, invoked at file-scope, where C disallows code (it must be in functions). See $exceptions if you have one to add by name. More troublesome is declarative macros used at top of new scope, like DECLARE_PER_CPU. These might just compile with a do-while-0 wrapper, but would be incorrect. Most of these are handled by detecting struct,union,etc declaration primitives in $exceptions. Theres also macros called inside an if (block), which "return" an expression. These cannot do-while, and need a ({}) wrapper. Enjoy this qualification while we work to improve our heuristics. WARNING: line length of 91 exceeds 80 columns #302: FILE: tools/include/linux/btf_ids.h:216: +/* First arg: kfunc symbol; rest: subsection suffix tokens matching bpf_verif_kfunc_. */ WARNING: line length of 87 exceeds 80 columns #304: FILE: tools/include/linux/btf_ids.h:218: + CONCATENATE(__BPF_VERIF_KFUNC_DEF_, COUNT_ARGS(__VA_ARGS__))(name, __VA_ARGS__) WARNING: macros should not use a trailing semicolon #313: FILE: tools/include/linux/btf_ids.h:231: +#define BTF_SET_SUB(name) static struct btf_id_set __maybe_unused name = { 0 }; total: 12 errors, 34 warnings, 0 checks, 279 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. Commit 7d5864e74335 ("bpf: Introduce BTF_SET/ID_SUB and BPF_VERIF_KFUNC_DEF") has style problems, please review. NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT BAD_REPORTED_BY_LINK CAMELCASE COMMIT_LOG_LONG_LINE FILE_PATH_CHANGES GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS.