lkml.org 
[lkml]   [2023]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 8/9] rcu: Make segcblist flags test strict
Date
While testing several flags at once, make sure that all of them verify
the test. This will be necessary to check if an rdp is (de-)offloading.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
kernel/rcu/rcu_segcblist.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/rcu/rcu_segcblist.h b/kernel/rcu/rcu_segcblist.h
index 620ca48e782b..36245efdf800 100644
--- a/kernel/rcu/rcu_segcblist.h
+++ b/kernel/rcu/rcu_segcblist.h
@@ -70,7 +70,7 @@ static inline void rcu_segcblist_clear_flags(struct rcu_segcblist *rsclp,
static inline bool rcu_segcblist_test_flags(struct rcu_segcblist *rsclp,
int flags)
{
- return READ_ONCE(rsclp->flags) & flags;
+ return (READ_ONCE(rsclp->flags) & flags) == flags;
}

/*
--
2.40.1
\
 
 \ /
  Last update: 2023-05-31 12:20    [W:0.144 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site