(fyi Marcin, the reason this isn't getting on the list is because your 3 tries have all included text and html) On Wed, 2017-02-22 at 14:31 +0100, Marcin Rokicki wrote: > > > > Here is an alternate style used a few times in the kernel > > > > Maybe it'd be nicer to change the macros to something like > > > > #define CASE_STR(x) case x: return #x > > > > and just return NULL after the switch/case block > > > > Maybe make that a global macro and consolidate the various > > uses to a single style [] > This alternate style used few times in the kernel cause that > checkpatch.pl prints > such messages: > - ERROR: Macros with complex values should be enclosed in parentheses > - WARNING: Macros with flow control statements should be avoided > > for "all" of your examples - except fm10k which is implemented (almost) in > the same way like above patch > but still prints: > - ERROR: Macros with multiple statements should be enclosed in a do - > while loop Yes, checkpatch is and will always be imperfect. It's just a bunch of regex tests. Anyway, the point of my email was to highlight a possible line count reduction and an opportunity to standardize a style. cheers, Joe