Commit 14d1ae2f authored by Philippe Gerum's avatar Philippe Gerum
Browse files

lockdep: irq_pipeline: fix ambiguous naming

lockdep_save/restore_irqs_state might convey the wrong information:
this is not about saving+disabling then conditionally re-enabling the
tracked state, but merely to read/write such state
unconditionally. Let's change this to non-equivocal names.
parent 8e9eadfe
......@@ -593,12 +593,10 @@ do { \
(running_oob() || this_cpu_read(hardirqs_enabled))); \
} while (0)
#define lockdep_save_irqs_state(__state) \
do { \
(__state) = this_cpu_read(hardirqs_enabled); \
} while (0)
#define lockdep_read_irqs_state() \
({ this_cpu_read(hardirqs_enabled); })
#define lockdep_restore_irqs_state(__state) \
#define lockdep_write_irqs_state(__state) \
do { \
this_cpu_write(hardirqs_enabled, __state); \
} while (0)
......@@ -641,8 +639,8 @@ do { \
# define lockdep_assert_irqs_enabled() do { } while (0)
# define lockdep_assert_irqs_disabled() do { } while (0)
# define lockdep_save_irqs_state(__state) do { (void)(__state); } while (0)
# define lockdep_restore_irqs_state(__state) do { (void)(__state); } while (0)
# define lockdep_read_irqs_state() 0
# define lockdep_write_irqs_state(__state) do { (void)(__state); } while (0)
# define lockdep_assert_in_irq() do { } while (0)
# define lockdep_assert_preemption_enabled() do { } while (0)
......
......@@ -9736,7 +9736,7 @@ bool dovetail_context_switch(struct dovetail_altsched_context *out,
* state maintained by lockdep must be preserved across
* switches.
*/
lockdep_save_irqs_state(lockdep_irqs);
lockdep_irqs = lockdep_read_irqs_state();
switch_to(prev, next, last);
barrier();
......@@ -9761,7 +9761,7 @@ bool dovetail_context_switch(struct dovetail_altsched_context *out,
else
preempt_count_sub(STAGE_OFFSET);
lockdep_restore_irqs_state(lockdep_irqs);
lockdep_write_irqs_state(lockdep_irqs);
/*
* Fixup the interrupt state conversely to what
......@@ -9775,7 +9775,7 @@ bool dovetail_context_switch(struct dovetail_altsched_context *out,
if (IS_ENABLED(CONFIG_HAVE_PERCPU_PREEMPT_COUNT))
preempt_count_set(pc);
lockdep_restore_irqs_state(lockdep_irqs);
lockdep_write_irqs_state(lockdep_irqs);
}
arch_dovetail_switch_finish(leave_inband);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment