rcupdate: remove dead code
PATCH 1/1 rcupdate: remove dead code
DEBUG_OBJECTS_RCU_HEAD depends on PREEMPT, so #ifndef CONFIG_PREEMPT is totally useless in kernel/rcupdate.c.
---
kernel/rcupdate.c +0 -5
@@ -215,10 +215,6 @@ static int rcuhead_fixup_free(void *addr, enum debug_obj_state state)* If we detect that we are nested in a RCU read-side critical * section, we should simply fail, otherwise we would deadlock. */ -#ifndef CONFIG_PREEMPT -WARN_ON (1 ); -return 0 ; -#else if (rcu_preempt_depth () !=0 ||preempt_count () !=0 ||irqs_disabled ()) {WARN_ON (1 );
@@ -229,7 +225,6 @@ static int rcuhead_fixup_free(void *addr, enum debug_obj_state state)rcu_barrier_bh ();debug_object_free (head, &rcuhead_debug_descr);return 1 ; -#endif default :return 0 ; }
Quoted 2 lines · Amerigo Wang
DEBUG_OBJECTS_RCU_HEADdepends on PREEMPT, so #ifndefCONFIG_PREEMPTis totally useless inkernel/rcupdate.c.
By "useless" I meant the code under #ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD, of course. :)
Quoted 6 lines · Cong Wang
Quoted 2 lines · Amerigo Wang
DEBUG_OBJECTS_RCU_HEADdepends on PREEMPT, so #ifndefCONFIG_PREEMPTis totally useless inkernel/rcupdate.c.By "useless" I meant the code under #ifdef
CONFIG_DEBUG_OBJECTS_RCU_HEAD, of course. :)
Yep, I did interpret it that way. ;-)
Thanx, Paul
Paul E. McKenney
AppliedQuoted 2 lines · Amerigo Wang
DEBUG_OBJECTS_RCU_HEADdepends on PREEMPT, so #ifndefCONFIG_PREEMPTis totally useless inkernel/rcupdate.c.
Queued, thank you, Amerigo!
I added a patch on top of this commenting why DEBUG_OBJECTS_RCU_HEAD is disallowed if !PREEMPT, FYI.
Thanx, Paul
Quoted 28 lines
Signed-off-by WANG Cong <[email protected]>Cc Paul E. McKenney <[email protected]>---
kernel/rcupdate.c +0
-5@@ -215,10 +215,6 @@ static int rcuhead_fixup_free(void *addr, enum debug_obj_state state)* If we detect that we are nested in a RCU read-side critical * section, we should simply fail, otherwise we would deadlock. */ -#ifndef CONFIG_PREEMPT -WARN_ON (1 ); -return 0 ; -#else if (rcu_preempt_depth () !=0 ||preempt_count () !=0 ||irqs_disabled ()) {WARN_ON (1 );@@ -229,7 +225,6 @@ static int rcuhead_fixup_free(void *addr, enum debug_obj_state state)rcu_barrier_bh ();debug_object_free (head, &rcuhead_debug_descr);return 1 ; -#endif default :return 0 ; }