Skip to contentSkip to conversation

atm: eni: Move semicolon to a new line after empty for loop

PATCH Applied Nathan Chancellor 2 participants 2 messages Oct 17, 2018 – Oct 18, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 atm: eni: Move semicolon to a new line after empty for loop

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.

---
 drivers/atm/eni.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/atm/eni.c +2 -1
index 6470e3c4c990..f8c703426c90 100644
@@ -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 */
Signature · 1 line
2.19.1
maintainer Applied
#1 lore raw

From: Nathan Chancellor <[email protected]>
Date: Wed, 17 Oct 2018 11:03:34 -0700

Quoted 9 lines

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

Quoted 6 lines

In this case, that loop is expected to be empty so silence the warning in the way that Clang suggests.

Applied.