linux/kernel/rcu
Nicholas Mc Guire f765d11307 rcu: Change return type to bool
Type-checking coccinelle spatches are being used to locate type mismatches
between function signatures and return values in this case this produced:
./kernel/rcu/srcu.c:271 WARNING: return of wrong type
        int != unsigned long,

srcu_readers_active() returns an int that is the sum of per_cpu unsigned
long but the only user is cleanup_srcu_struct() which is using it as a
boolean (condition) to see if there is any readers rather than actually
using the approximate number of readers. The theoretically possible
unsigned long overflow case does not need to be handled explicitly - if
we had 4G++ readers then something else went wrong a long time ago.

proposal: change the return type to boolean. The function name is left
          unchanged as it fits the naming expectation for a boolean.

patch was compile tested for x86_64_defconfig (implies CONFIG_SRCU=y)

patch is against 4.1-rc5 (localversion-next is -next-20150525)

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2015-07-15 14:43:53 -07:00
..
Makefile rcu: Make SRCU optional by using CONFIG_SRCU 2015-01-06 11:04:29 -08:00
rcu.h tiny_rcu: Directly force QS when call_rcu_[bh|sched]() on idle_task 2015-01-06 11:01:12 -08:00
rcutorture.c rcutorture: Test SRCU cleanup code path 2015-05-27 12:59:58 -07:00
srcu.c rcu: Change return type to bool 2015-07-15 14:43:53 -07:00
tiny_plugin.h rcu: Convert ACCESS_ONCE() to READ_ONCE() and WRITE_ONCE() 2015-05-27 12:56:15 -07:00
tiny.c This patch series contains several clean ups and even a new trace clock 2015-06-26 14:02:43 -07:00
tree_plugin.h Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-06-22 18:57:44 -07:00
tree_trace.c rcu: Convert ACCESS_ONCE() to READ_ONCE() and WRITE_ONCE() 2015-05-27 12:56:15 -07:00
tree.c rcu: Drop RCU_USER_QS in favor of NO_HZ_FULL 2015-07-06 13:52:18 -07:00
tree.h Merge branches 'array.2015.05.27a', 'doc.2015.05.27a', 'fixes.2015.05.27a', 'hotplug.2015.05.27a', 'init.2015.05.27a', 'tiny.2015.05.27a' and 'torture.2015.05.27a' into HEAD 2015-05-27 13:00:49 -07:00
update.c rcu: Deinline rcu_read_lock_sched_held() if DEBUG_LOCK_ALLOC 2015-07-15 14:43:52 -07:00