* [PATCH] atm: eni: Move semicolon to a new line after empty for loop
@ 2018-10-17 18:03 Nathan Chancellor
2018-10-18 22:41 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Nathan Chancellor @ 2018-10-17 18:03 UTC (permalink / raw)
To: Chas Williams; +Cc: linux-atm-general, netdev, linux-kernel, Nathan Chancellor
Clang warns:
drivers/atm/eni.c:244:48: error: for loop has empty body
[-Werror,-Wempty-body]
for (order = 0; (1 << order) < *size; order++);
^
drivers/atm/eni.c:244:48: note: put the semicolon on a separate line to
silence this warning
In this case, that loop is expected to be empty so silence the warning
in the way that Clang suggests.
Link: https://github.com/ClangBuiltLinux/linux/issues/42
Suggested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---
drivers/atm/eni.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c
index 6470e3c4c990..f8c703426c90 100644
--- a/drivers/atm/eni.c
+++ b/drivers/atm/eni.c
@@ -241,7 +241,8 @@ static void __iomem *eni_alloc_mem(struct eni_dev *eni_dev, unsigned long *size)
len = eni_dev->free_len;
if (*size < MID_MIN_BUF_SIZE) *size = MID_MIN_BUF_SIZE;
if (*size > MID_MAX_BUF_SIZE) return NULL;
- for (order = 0; (1 << order) < *size; order++);
+ for (order = 0; (1 << order) < *size; order++)
+ ;
DPRINTK("trying: %ld->%d\n",*size,order);
best_order = 65; /* we don't have more than 2^64 of anything ... */
index = 0; /* silence GCC */
--
2.19.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] atm: eni: Move semicolon to a new line after empty for loop
2018-10-17 18:03 [PATCH] atm: eni: Move semicolon to a new line after empty for loop Nathan Chancellor
@ 2018-10-18 22:41 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-10-18 22:41 UTC (permalink / raw)
To: natechancellor; +Cc: 3chas3, linux-atm-general, netdev, linux-kernel
From: Nathan Chancellor <natechancellor@gmail.com>
Date: Wed, 17 Oct 2018 11:03:34 -0700
> Clang warns:
>
> drivers/atm/eni.c:244:48: error: for loop has empty body
> [-Werror,-Wempty-body]
> for (order = 0; (1 << order) < *size; order++);
> ^
> drivers/atm/eni.c:244:48: note: put the semicolon on a separate line to
> silence this warning
>
> In this case, that loop is expected to be empty so silence the warning
> in the way that Clang suggests.
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/42
> Suggested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-18 22:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-17 18:03 [PATCH] atm: eni: Move semicolon to a new line after empty for loop Nathan Chancellor
2018-10-18 22:41 ` David Miller
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.