Kernel: Simplify disable_irq() and enable_irq() methods in IRQHandler
Setting the m_enabled variable to true or false can help with monitoring the IRQHandler object(s) later, and there's no good reason to have an if-else statement in those methods anyway.
This commit is contained in:
parent
cb676f1211
commit
8b38be3072
Notes:
sideshowbarker
2024-07-19 08:09:06 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/8b38be3072f Pull-request: https://github.com/SerenityOS/serenity/pull/1361 Reviewed-by: https://github.com/awesomekling
1 changed files with 3 additions and 4 deletions
|
@ -36,6 +36,7 @@ IRQHandler::IRQHandler(u8 irq)
|
|||
: GenericInterruptHandler(irq)
|
||||
, m_responsible_irq_controller(InterruptManagement::the().get_responsible_irq_controller(irq))
|
||||
{
|
||||
disable_irq();
|
||||
}
|
||||
|
||||
IRQHandler::~IRQHandler()
|
||||
|
@ -60,10 +61,9 @@ void IRQHandler::enable_irq()
|
|||
#ifdef IRQ_DEBUG
|
||||
dbg() << "Enable IRQ " << interrupt_number();
|
||||
#endif
|
||||
m_enabled = true;
|
||||
if (!m_shared_with_others)
|
||||
m_responsible_irq_controller->enable(*this);
|
||||
else
|
||||
m_enabled = true;
|
||||
}
|
||||
|
||||
void IRQHandler::disable_irq()
|
||||
|
@ -71,10 +71,9 @@ void IRQHandler::disable_irq()
|
|||
#ifdef IRQ_DEBUG
|
||||
dbg() << "Disable IRQ " << interrupt_number();
|
||||
#endif
|
||||
m_enabled = false;
|
||||
if (!m_shared_with_others)
|
||||
m_responsible_irq_controller->disable(*this);
|
||||
else
|
||||
m_enabled = false;
|
||||
}
|
||||
|
||||
void IRQHandler::change_irq_number(u8 irq)
|
||||
|
|
Loading…
Add table
Reference in a new issue