All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] cmd/tpm_test: Fix misleading code indentation
@ 2016-10-16 15:13 Stefan Brüns
  2016-10-17 22:17 ` Simon Glass
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Brüns @ 2016-10-16 15:13 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] cmd/tpm_test: Fix misleading code indentation
  2016-10-16 15:13 [U-Boot] [PATCH] cmd/tpm_test: Fix misleading code indentation Stefan Brüns
@ 2016-10-17 22:17 ` Simon Glass
  2016-10-25 18:39   ` Simon Glass
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Glass @ 2016-10-17 22:17 UTC (permalink / raw)
  To: u-boot

On 16 October 2016 at 09:13, Stefan Br?ns <stefan.bruens@rwth-aachen.de> wrote:
> 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(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] cmd/tpm_test: Fix misleading code indentation
  2016-10-17 22:17 ` Simon Glass
@ 2016-10-25 18:39   ` Simon Glass
  0 siblings, 0 replies; 3+ messages in thread
From: Simon Glass @ 2016-10-25 18:39 UTC (permalink / raw)
  To: u-boot

On 17 October 2016 at 16:17, Simon Glass <sjg@chromium.org> wrote:
> On 16 October 2016 at 09:13, Stefan Br?ns <stefan.bruens@rwth-aachen.de> wrote:
>> 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(-)
>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Updated to drop the C99 variable decl.

Applied to u-boot-dm/next, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-10-25 18:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-16 15:13 [U-Boot] [PATCH] cmd/tpm_test: Fix misleading code indentation Stefan Brüns
2016-10-17 22:17 ` Simon Glass
2016-10-25 18:39   ` Simon Glass

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.