Thread (2 messages) flat view 2 messages, 2 authors, 2017-04-05

Re: [PATCH] ath10k: Modify macros to fix style issues

From: Joe Perches <joe@perches.com>
Date: 2017-02-22 16:20:09

(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:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help