linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Jespersen <laumann.thomas@gmail.com>
To: gaoxiang25@huawei.com, yuchao0@huawei.com
Cc: gregkh@linuxfoundation.org, linux-erofs@lists.ozlabs.org,
	linux-kernel@vger.kernel.org,
	Thomas Jespersen <laumann.thomas@gmail.com>
Subject: [PATCH] staging: erofs: Add braces to do-while statements
Date: Sun,  9 Dec 2018 16:59:00 +0100	[thread overview]
Message-ID: <20181209155900.10164-1-laumann.thomas@gmail.com> (raw)

This fixes warning reported by sparse (with -Wsparse-all).

Signed-off-by: Thomas Jespersen <laumann.thomas@gmail.com>
---
 drivers/staging/erofs/internal.h | 4 ++--
 drivers/staging/erofs/utils.c    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/erofs/internal.h b/drivers/staging/erofs/internal.h
index 57575c7f5635..bf180a803446 100644
--- a/drivers/staging/erofs/internal.h
+++ b/drivers/staging/erofs/internal.h
@@ -232,9 +232,9 @@ static inline bool erofs_workgroup_get(struct erofs_workgroup *grp, int *ocnt)
 	/* spin if it is temporarily locked at the reclaim path */
 	if (unlikely(o == locked)) {
 #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
-		do
+		do {
 			cpu_relax();
-		while (atomic_read(&grp->refcount) == locked);
+		} while (atomic_read(&grp->refcount) == locked);
 #endif
 		goto repeat;
 	}
diff --git a/drivers/staging/erofs/utils.c b/drivers/staging/erofs/utils.c
index ea8a962e5c95..cd76df4a48c7 100644
--- a/drivers/staging/erofs/utils.c
+++ b/drivers/staging/erofs/utils.c
@@ -217,9 +217,9 @@ unsigned long erofs_shrink_scan(struct shrinker *shrink,
 	unsigned long freed = 0;
 
 	spin_lock(&erofs_sb_list_lock);
-	do
+	do {
 		run_no = ++shrinker_run_no;
-	while (run_no == 0);
+	} while (run_no == 0);
 
 	/* Iterate over all mounted superblocks and try to shrink them */
 	p = erofs_sb_list.next;
-- 
2.19.2


             reply	other threads:[~2018-12-09 15:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-09 15:59 Thomas Jespersen [this message]
2018-12-09 16:20 ` [PATCH] staging: erofs: Add braces to do-while statements Greg KH
2018-12-09 17:27   ` Joe Perches
2018-12-09 19:40     ` Greg KH
2018-12-10  0:42       ` Luc Van Oostenryck
2018-12-09 17:30   ` Joe Perches
2018-12-09 21:37 ` Gao Xiang

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=20181209155900.10164-1-laumann.thomas@gmail.com \
    --to=laumann.thomas@gmail.com \
    --cc=gaoxiang25@huawei.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yuchao0@huawei.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).