From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= Date: Sun, 16 Oct 2016 17:13:55 +0200 Subject: [U-Boot] [PATCH] cmd/tpm_test: Fix misleading code indentation Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- 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