Skip to content

Commit fe13889

Browse files
changbinduKAGA-KOKO
authored andcommitted
genirq, softirq: Use in_hardirq() instead of in_irq()
Replace the obsolete and ambiguos macro in_irq() with the new macro in_hardirq(). Signed-off-by: Changbin Du <changbin.du@gmail.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20220128110727.5110-1-changbin.du@gmail.com
1 parent 26291c5 commit fe13889

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

kernel/irq/irqdesc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ int handle_irq_desc(struct irq_desc *desc)
640640
return -EINVAL;
641641

642642
data = irq_desc_get_irq_data(desc);
643-
if (WARN_ON_ONCE(!in_irq() && handle_enforce_irqctx(data)))
643+
if (WARN_ON_ONCE(!in_hardirq() && handle_enforce_irqctx(data)))
644644
return -EPERM;
645645

646646
generic_handle_irq_desc(desc);
@@ -676,7 +676,7 @@ EXPORT_SYMBOL_GPL(generic_handle_irq);
676676
*/
677677
int generic_handle_domain_irq(struct irq_domain *domain, unsigned int hwirq)
678678
{
679-
WARN_ON_ONCE(!in_irq());
679+
WARN_ON_ONCE(!in_hardirq());
680680
return handle_irq_desc(irq_resolve_mapping(domain, hwirq));
681681
}
682682
EXPORT_SYMBOL_GPL(generic_handle_domain_irq);

kernel/softirq.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ void __local_bh_enable_ip(unsigned long ip, unsigned int cnt)
222222
u32 pending;
223223
int curcnt;
224224

225-
WARN_ON_ONCE(in_irq());
225+
WARN_ON_ONCE(in_hardirq());
226226
lockdep_assert_irqs_enabled();
227227

228228
local_irq_save(flags);
@@ -305,7 +305,7 @@ void __local_bh_disable_ip(unsigned long ip, unsigned int cnt)
305305
{
306306
unsigned long flags;
307307

308-
WARN_ON_ONCE(in_irq());
308+
WARN_ON_ONCE(in_hardirq());
309309

310310
raw_local_irq_save(flags);
311311
/*
@@ -352,14 +352,14 @@ static void __local_bh_enable(unsigned int cnt)
352352
*/
353353
void _local_bh_enable(void)
354354
{
355-
WARN_ON_ONCE(in_irq());
355+
WARN_ON_ONCE(in_hardirq());
356356
__local_bh_enable(SOFTIRQ_DISABLE_OFFSET);
357357
}
358358
EXPORT_SYMBOL(_local_bh_enable);
359359

360360
void __local_bh_enable_ip(unsigned long ip, unsigned int cnt)
361361
{
362-
WARN_ON_ONCE(in_irq());
362+
WARN_ON_ONCE(in_hardirq());
363363
lockdep_assert_irqs_enabled();
364364
#ifdef CONFIG_TRACE_IRQFLAGS
365365
local_irq_disable();
@@ -618,7 +618,7 @@ static inline void tick_irq_exit(void)
618618

619619
/* Make sure that timer wheel updates are propagated */
620620
if ((idle_cpu(cpu) && !need_resched()) || tick_nohz_full_cpu(cpu)) {
621-
if (!in_irq())
621+
if (!in_hardirq())
622622
tick_nohz_irq_exit();
623623
}
624624
#endif

0 commit comments

Comments
 (0)