kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: joe@perches.com (Joe Perches)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Submitted a first patch and no reply
Date: Thu, 08 Jan 2015 13:14:39 -0800	[thread overview]
Message-ID: <1420751679.11784.11.camel@perches.com> (raw)
In-Reply-To: <79493.1420750167@turing-police.cc.vt.edu>

On Thu, 2015-01-08 at 15:49 -0500, Valdis.Kletnieks at vt.edu wrote:
> On Thu, 08 Jan 2015 12:37:15 -0800, shirish gajera said:
> 
> > That's hwy I just fix one warning.
> 
> That means "don't fix a warning about indentation *and* a  warning
> about trailing blanks in the same patch".
> 
> Also, if you're fixing a style issue, you should actually *review* the
> code, and make sure you fix the issue everywhere, *even if the other ones
> didn't prompt a warning*.
> 
> It's interesting that the warning only popped on the one case where the
> "/* looping version */" is on a separate line, not on the #else line.
> 
> Am cc'ing Joe Perches for that question. Joe - to get you up to speed,
> checkpatch was run against drivers/staging/skein/skein_block.c, and it
> flagged one definition of the macro R256, but not the other one, or the
> two definitions each for R512 and R1024.  Any idea why?

I believe the comment in the macro interferes with
the perl regex.

        #if SKEIN_UNROLL_256 == 0
        #define R256(p0, p1, p2, p3, ROT, r_num) /* fully unrolled */ \
        do {                                                          \
        	ROUND256(p0, p1, p2, p3, ROT, r_num);                 \
        } while (0)

With the latest version in -next I get:

$ ./scripts/checkpatch.pl -f --strict drivers/staging/skein/skein_block.c --types=SINGLE_STATEMENT_DO_WHILE_MACRO
WARNING: Single statement macros should not use a do {} while (0) loop
#85: FILE: drivers/staging/skein/skein_block.c:85:
+#define R256(p0, p1, p2, p3, ROT, r_num) \
+do { \
+	ROUND256(p0, p1, p2, p3, ROT, r_num); \
+} while (0)

WARNING: Single statement macros should not use a do {} while (0) loop
#176: FILE: drivers/staging/skein/skein_block.c:176:
+#define R512(p0, p1, p2, p3, p4, p5, p6, p7, ROT, r_num)                 \
+do {                                                                     \
+	ROUND512(p0, p1, p2, p3, p4, p5, p6, p7, ROT, r_num);            \
+} while (0)

WARNING: Single statement macros should not use a do {} while (0) loop
#264: FILE: drivers/staging/skein/skein_block.c:264:
+#define R1024(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, pA, pB, pC, pD, pE, pF, \
+	      ROT, rn)                                                        \
+do {                                                                          \
+	ROUND1024(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, pA, pB, pC, pD, pE, \
+		  pF, ROT, rn);                                               \
+} while (0)

WARNING: Single statement macros should not use a do {} while (0) loop
#292: FILE: drivers/staging/skein/skein_block.c:292:
+#define R1024(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, pA, pB, pC, pD, pE, pF, \
+	      ROT, rn)                                                        \
+do {                                                                          \
+	ROUND1024(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, pA, pB, pC, pD, pE, \
+		  pF, ROT, rn);                                               \
+} while (0)

total: 0 errors, 4 warnings, 0 checks, 795 lines checked

NOTE: Used message types: SINGLE_STATEMENT_DO_WHILE_MACRO

drivers/staging/skein/skein_block.c has style problems, please review.

If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.

  reply	other threads:[~2015-01-08 21:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-08 20:00 Submitted a first patch and no reply shirish gajera
2015-01-08 20:32 ` Valdis.Kletnieks at vt.edu
2015-01-08 20:37   ` shirish gajera
2015-01-08 20:49     ` Valdis.Kletnieks at vt.edu
2015-01-08 21:14       ` Joe Perches [this message]
2015-01-08 21:25         ` shirish gajera
2015-01-08 21:31       ` [PATCH] checkpatch: Allow comments in macros tested for single statements Joe Perches
2015-01-09 16:55 ` Submitted a first patch and no reply michi1 at michaelblizek.twilightparadox.com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1420751679.11784.11.camel@perches.com \
    --to=joe@perches.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).