Skip to contentSkip to conversation

libxfs: fix xfs_extent_busy_flush macro definition

PATCH In review Darrick J. Wong 2 participants 5 messages Apr 8, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxfs: fix xfs_extent_busy_flush macro definition

xfs_extent_busy_flush is a void function, so don't reduce it to zero. This shuts up gcc warnings about do-nothing statements.

---
 libxfs/libxfs_priv.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libxfs/libxfs_priv.h +1 -1
index c2d4494..167786e 100644
@@ -419,7 +419,7 @@ roundup_64(__uint64_t x, __uint32_t y)
 	*(busy_gen) = __foo;					\
 	false;							\
 })
-#define xfs_extent_busy_flush(mp,pag,busy_gen)		(0)
+#define xfs_extent_busy_flush(mp,pag,busy_gen)		do { } while(0)
 
 /* avoid unused variable warning */
 #define xfs_alloc_busy_insert(tp,ag,b,len)	({	\
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Darrick J. Wong

xfs_extent_busy_flush is a void function, so don't reduce it to zero. This shuts up gcc warnings about do-nothing statements.

Whoops, thanks. Need to test w/ newer gcc I guess, sorry!

Quoted 22 lines
---
 libxfs/libxfs_priv.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libxfs/libxfs_priv.h +1 -2
index c2d4494..167786e 100644
@@ -419,7 +419,7 @@ roundup_64(__uint64_t x, __uint32_t y)
 	*(busy_gen) = __foo;					\
 	false;							\
 })
-#define xfs_extent_busy_flush(mp,pag,busy_gen)		(0)
+#define xfs_extent_busy_flush(mp,pag,busy_gen)		do { } while(0)
 
 /* avoid unused variable warning */
 #define xfs_alloc_busy_insert(tp,ag,b,len)	({	\
--

To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 9 lines · Eric Sandeen
Quoted 4 lines · Darrick J. Wong

xfs_extent_busy_flush is a void function, so don't reduce it to zero. This shuts up gcc warnings about do-nothing statements.

Whoops, thanks. Need to test w/ newer gcc I guess, sorry!

Oh, actually it seems that we use ((void) 0) pretty consistently for these, i.e. -

#define xfs_extent_busy_reuse(mp,ag,bno,len,user) ((void) 0)

and many others. Probably best to be consistent; I may "fix" it to that on commit, ok?

-Eric

Quoted 27 lines
Quoted 18 lines
---
 libxfs/libxfs_priv.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libxfs/libxfs_priv.h +1 -2
index c2d4494..167786e 100644
@@ -419,7 +419,7 @@ roundup_64(__uint64_t x, __uint32_t y)
 	*(busy_gen) = __foo;					\
 	false;							\
 })
-#define xfs_extent_busy_flush(mp,pag,busy_gen)		(0)
+#define xfs_extent_busy_flush(mp,pag,busy_gen)		do { } while(0)
 
 /* avoid unused variable warning */
 #define xfs_alloc_busy_insert(tp,ag,b,len)	({	\
--
Quoted 4 lines

To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 11 lines · Eric Sandeen
Quoted 9 lines · Eric Sandeen
Quoted 4 lines · Darrick J. Wong

xfs_extent_busy_flush is a void function, so don't reduce it to zero. This shuts up gcc warnings about do-nothing statements.

Whoops, thanks. Need to test w/ newer gcc I guess, sorry!

Quoted 7 lines

Oh, actually it seems that we use ((void) 0) pretty consistently for these, i.e. -

#define xfs_extent_busy_reuse(mp,ag,bno,len,user) ((void) 0)

and many others. Probably best to be consistent; I may "fix" it to that on commit, ok?

That works too.

You might consider fixing xfs_icsb_reinit_counters while you're at it, because that's where I picked up that idio[mt].

Oh, nobody calls xfs_icsb_reinit_counters. Get rid of it then.

--D

Quoted 30 lines

-Eric

Quoted 27 lines
Quoted 18 lines
---
 libxfs/libxfs_priv.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libxfs/libxfs_priv.h +1 -2
index c2d4494..167786e 100644
@@ -419,7 +419,7 @@ roundup_64(__uint64_t x, __uint32_t y)
 	*(busy_gen) = __foo;					\
 	false;							\
 })
-#define xfs_extent_busy_flush(mp,pag,busy_gen)		(0)
+#define xfs_extent_busy_flush(mp,pag,busy_gen)		do { } while(0)
 
 /* avoid unused variable warning */
 #define xfs_alloc_busy_insert(tp,ag,b,len)	({	\
--
Quoted 4 lines

To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
Quoted 20 lines · Darrick J. Wong
Quoted 11 lines · Eric Sandeen
Quoted 9 lines · Eric Sandeen
Quoted 4 lines · Darrick J. Wong

xfs_extent_busy_flush is a void function, so don't reduce it to zero. This shuts up gcc warnings about do-nothing statements.

Whoops, thanks. Need to test w/ newer gcc I guess, sorry!

Quoted 7 lines

Oh, actually it seems that we use ((void) 0) pretty consistently for these, i.e. -

#define xfs_extent_busy_reuse(mp,ag,bno,len,user) ((void) 0)

and many others. Probably best to be consistent; I may "fix" it to that on commit, ok?

Quoted 6 lines

That works too.

You might consider fixing xfs_icsb_reinit_counters while you're at it, because that's where I picked up that idio[mt].

Oh, nobody calls xfs_icsb_reinit_counters. Get rid of it then.

Oh, you already did. Ho hum.

--D

Quoted 37 lines

--D

Quoted 30 lines

-Eric

Quoted 27 lines
Quoted 18 lines
---
 libxfs/libxfs_priv.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libxfs/libxfs_priv.h +1 -2
index c2d4494..167786e 100644
@@ -419,7 +419,7 @@ roundup_64(__uint64_t x, __uint32_t y)
 	*(busy_gen) = __foo;					\
 	false;							\
 })
-#define xfs_extent_busy_flush(mp,pag,busy_gen)		(0)
+#define xfs_extent_busy_flush(mp,pag,busy_gen)		do { } while(0)
 
 /* avoid unused variable warning */
 #define xfs_alloc_busy_insert(tp,ag,b,len)	({	\
--
Quoted 4 lines

To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html