All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Stefan Brüns" <stefan.bruens@rwth-aachen.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] cmd/tpm_test: Fix misleading code indentation
Date: Sun, 16 Oct 2016 17:13:55 +0200	[thread overview]
Message-ID: <d2475f43c83d4c5c851a06bf6916f72f@rwthex-w2-b.rwth-ad.de> (raw)

GCC 6.2 reasonably complains about the current code:

../cmd/tpm_test.c: In function ?do_tpmtest?:
../cmd/tpm_test.c:540:3: warning: this ?for? clause does not guard... [-Wmisleading-indentation]
   for (i = 0; i < argc; i++)
   ^~~
../cmd/tpm_test.c:542:4: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ?for?
    printf("\n------\n");
    ^~~~~~

Signed-off-by: Stefan Br?ns <stefan.bruens@rwth-aachen.de>
---
 cmd/tpm_test.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/cmd/tpm_test.c b/cmd/tpm_test.c
index 65332d1..4af4d71 100644
--- a/cmd/tpm_test.c
+++ b/cmd/tpm_test.c
@@ -534,13 +534,12 @@ static int do_tpmtest(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	cmd_tbl_t *c;
 
 	printf("argc = %d, argv = ", argc);
-	do {
-		int i = 0;
 
-		for (i = 0; i < argc; i++)
-			printf(" %s", argv[i]);
-			printf("\n------\n");
-		} while (0);
+	for (int i = 0; i < argc; i++)
+		printf(" %s", argv[i]);
+
+	printf("\n------\n");
+
 	argc--;
 	argv++;
 	c = find_cmd_tbl(argv[0], cmd_cros_tpm_sub,
-- 
2.10.1

             reply	other threads:[~2016-10-16 15:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-16 15:13 Stefan Brüns [this message]
2016-10-17 22:17 ` [U-Boot] [PATCH] cmd/tpm_test: Fix misleading code indentation Simon Glass
2016-10-25 18:39   ` Simon Glass

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=d2475f43c83d4c5c851a06bf6916f72f@rwthex-w2-b.rwth-ad.de \
    --to=stefan.bruens@rwth-aachen.de \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.