mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:47:45 +00:00
Kernel/Audio: Implement 2 correctness fixes in AC97
The fixes are: 1. Don't copy PCI::DeviceIdentifier during construction. This is a heavy structure to copy so we definitely don't want to do that. Instead, use a const reference to it like what happens in other parts in the Kernel. 2. Declare the constructor as explicit to avoid construction errors.
This commit is contained in:
parent
45844f9338
commit
8abc4fa8c2
2 changed files with 2 additions and 2 deletions
|
@ -44,7 +44,7 @@ UNMAP_AFTER_INIT void AC97::detect()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
UNMAP_AFTER_INIT AC97::AC97(PCI::DeviceIdentifier pci_device_identifier)
|
UNMAP_AFTER_INIT AC97::AC97(PCI::DeviceIdentifier const& pci_device_identifier)
|
||||||
: PCI::Device(pci_device_identifier.address())
|
: PCI::Device(pci_device_identifier.address())
|
||||||
, IRQHandler(pci_device_identifier.interrupt_line().value())
|
, IRQHandler(pci_device_identifier.interrupt_line().value())
|
||||||
, CharacterDevice(42, 42)
|
, CharacterDevice(42, 42)
|
||||||
|
|
|
@ -145,7 +145,7 @@ private:
|
||||||
StringView m_name;
|
StringView m_name;
|
||||||
};
|
};
|
||||||
|
|
||||||
AC97(PCI::DeviceIdentifier);
|
explicit AC97(PCI::DeviceIdentifier const&);
|
||||||
|
|
||||||
// ^IRQHandler
|
// ^IRQHandler
|
||||||
virtual bool handle_irq(const RegisterState&) override;
|
virtual bool handle_irq(const RegisterState&) override;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue