Skip to contentSkip to conversation

rculist: Silence unused-value warning.

PATCH In review Suraj Upadhyay 2 participants 3 messages Jul 19, 2020 1 message not in the archive RCU

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rculist: Silence unused-value warning.

The macro __list_check_srcu is used as a statement inside a for loop.

__list_check_srcu becomes "true" when CONFIG_PROVE_RCU_LIST is not defined. This results in compiler warning about an unused value ("true").

Silence the compiler warning about the unused value "true" by replacing it with an empty expression.

---
 include/linux/rculist.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/rculist.h +1 -1
index de9385b9158e..8b8e0584c473 100644
@@ -73,7 +73,7 @@ static inline void INIT_LIST_HEAD_RCU(struct list_head *list)
 #define __list_check_rcu(dummy, cond, extra...)				\
 	({ check_arg_count_one(extra); })
 
-#define __list_check_srcu(cond) true
+#define __list_check_srcu(cond) ({})
 #endif
 
 /*
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 9 lines · Suraj Upadhyay

The macro __list_check_srcu is used as a statement inside a for loop.

__list_check_srcu becomes "true" when CONFIG_PROVE_RCU_LIST is not defined. This results in compiler warning about an unused value ("true").

Silence the compiler warning about the unused value "true" by replacing it with an empty expression.

Like this, you mean, give or take whitespace? ;-)

https://lore.kernel.org/lkml/20200718001259.GY9247@paulmck-ThinkPad-P72/

May I add your Tested-by?

Thanx, Paul

Quoted 20 lines
---
 include/linux/rculist.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/rculist.h +1 -1
index de9385b9158e..8b8e0584c473 100644
@@ -73,7 +73,7 @@ static inline void INIT_LIST_HEAD_RCU(struct list_head *list)
 #define __list_check_rcu(dummy, cond, extra...)				\
 	({ check_arg_count_one(extra); })
 
-#define __list_check_srcu(cond) true
+#define __list_check_srcu(cond) ({})
 #endif
 
 /*
Signature · 1 line
2.17.1

A message that is not in the archive (sent off-list or not yet received): CAGbbQbG5ZLRhc+nxLqM35K3_cbXKw3AM1hXPm0fkyBEfRRhAnA@mail.gmail.com

maintainer
#3 lore raw
Quoted 16 lines · Suraj Upadhyay
Quoted 14 lines · On Sun 19 Jul, 2020, 21:37 Paul E. McKenney, <[email protected]> wrote:
Quoted 3 lines · Suraj Upadhyay

The macro __list_check_srcu is used as a statement inside a for loop.

__list_check_srcu becomes "true" when CONFIG_PROVE_RCU_LIST is not

defined.

Quoted 6 lines

This results in compiler warning about an unused value ("true").

Silence the compiler warning about the unused value "true" by replacing it with an empty expression.

Like this, you mean, give or take whitespace? ;-)

Quoted 8 lines
Quoted 6 lines

https://lore.kernel.org/lkml/20200718001259.GY9247@paulmck-ThinkPad-P72/

May I add your Tested-by?

Thanx, Paul

Yeah sure.

Thank you, I have applied it and it will be public on my next rebase. And thank you for your testing efforts!

Thanx, Paul

Quoted 29 lines

Thanks,

Suraj Upadhyay.

Quoted 25 lines

---

include/linux/rculist.h static inline void INIT_LIST_HEAD_RCU(struct list_head

Quoted 8 lines
 include/linux/rculist.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/rculist.h +0 -0
index de9385b9158e..8b8e0584c473 100644
@@ -73,7 +73,7 @@ static inline void INIT_LIST_HEAD_RCU(struct list_head

*list)

include/linux/rculist.h static inline void INIT_LIST_HEAD_RCU(struct list_head · line 73

Quoted 1 line
include/linux/rculist.h +0 -0
 #define __list_check_rcu(dummy, cond, extra...)
      \
Quoted 10 lines
include/linux/rculist.h +1 -2
      ({ check_arg_count_one(extra); })
 
-#define __list_check_srcu(cond) true
+#define __list_check_srcu(cond) ({})
 #endif
 
 /*
--

2.17.1