Skip to contentSkip to conversation

staging: erofs: Add braces to do-while statements

PATCH New Thomas Jespersen 2 participants 2 messages Dec 8, 2018 – Dec 9, 2018 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: erofs: Add braces to do-while statements

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

Signed-off-by Thomas Jespersen <laumann.thomas at gmail.com>
---
 drivers/staging/erofs/internal.h | 4 ++--
 drivers/staging/erofs/utils.c    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/erofs/internal.h +2 -2
index 57575c7f56355424a..bf180a803446655d4 100644
@@ -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;
 	}
drivers/staging/erofs/utils.c +2 -2
index ea8a962e5c9504a2c..cd76df4a48c734eb4 100644
@@ -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;
Signature · 1 line
2.19.2
#1 lore raw

PATCH 1/1 staging: erofs: Add braces to do-while statements

Hi Thomas,

Quoted 14 lines · Thomas Jespersen

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

Signed-off-by Thomas Jespersen <laumann.thomas at gmail.com>
---
 drivers/staging/erofs/internal.h | 4 ++--
 drivers/staging/erofs/utils.c    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/erofs/internal.h +0 -0
index 57575c7f56355424a..bf180a803446655d4 100644
@@ -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 */

drivers/staging/erofs/internal.h static inline bool erofs_workgroup_get(struct erofs_workgroup *grp, int *ocnt) · line 240

Quoted 10 lines
drivers/staging/erofs/internal.h +2 -2
 	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;
 	}

Could you check the latest source code at
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/tree/drivers/staging/erofs?h=staging-next
the above you sent doesn't seem the latest source code...

and send your patch to Greg and the staging mailing list as well? if you want to upstream immediately.

To:
Greg Kroah-Hartman <gregkh at linuxfoundation.org>
linux-staging mailing list <devel at driverdev.osuosl.org>

  linux-erofs mailing list   <linux-erofs at lists.ozlabs.org>
  Gao Xiang                  <gaoxiang25 at huawei.com>
  Chao Yu                    <yuchao0 at huawei.com>

Thanks,
Gao Xiang