cstyle: understand basic top-level macro invocations
commit903895ea5f5f4bd21f654f84c17b4d294ac65049
authorRob Norris <robn@despairlabs.com>
Wed, 4 Dec 2024 06:48:38 +0000 (4 17:48 +1100)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 6 Dec 2024 16:53:12 +0000 (6 08:53 -0800)
tree1013e452998b81c871c432946ae087ad7a36a3a2
parenta44eaf16909a81b8ca42c7937e089e4a83125868
cstyle: understand basic top-level macro invocations

We quite often invoke macros outside of functions, usually to generate
functions or data. cstyle inteprets these as function headers, which at
least have opinions for indenting.

This introduces a separate state for top-level macro invocations, and
excludes it from matching functions. For the moment, most of the
existing rules will continue to apply, but this gives us a way to add or
removes rules targeting macros specifically.

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes #16840
scripts/cstyle.pl