Skip to content

Commit

Permalink
Kernel: Change get_sharing_devices_count() in GenericInterruptHandler
Browse files Browse the repository at this point in the history
The new method' name is sharing_devices_count().
The Serenity Coding Style tends to not accept the word "get" in
methods' names if possible.
  • Loading branch information
supercomputer7 authored and awesomekling committed Feb 24, 2020
1 parent a7d7c0e commit fe66496
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Kernel/Arch/i386/CPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ void register_generic_interrupt_handler(u8 interrupt_number, GenericInterruptHan
ASSERT(s_interrupt_handler[interrupt_number]->purpose() == HandlerPurpose::SharedIRQHandler);
static_cast<SharedIRQHandler*>(s_interrupt_handler[interrupt_number])->register_handler(handler);
return;
}
}
if (!s_interrupt_handler[interrupt_number]->is_shared_handler()) {
ASSERT(s_interrupt_handler[interrupt_number]->purpose() == HandlerPurpose::IRQHandler);
auto& previous_handler = *s_interrupt_handler[interrupt_number];
Expand All @@ -464,7 +464,7 @@ void unregister_generic_interrupt_handler(u8 interrupt_number, GenericInterruptH
if (s_interrupt_handler[interrupt_number]->is_shared_handler() && !s_interrupt_handler[interrupt_number]->is_sharing_with_others()) {
ASSERT(s_interrupt_handler[interrupt_number]->purpose() == HandlerPurpose::SharedIRQHandler);
static_cast<SharedIRQHandler*>(s_interrupt_handler[interrupt_number])->unregister_handler(handler);
if (!static_cast<SharedIRQHandler*>(s_interrupt_handler[interrupt_number])->get_sharing_devices_count()) {
if (!static_cast<SharedIRQHandler*>(s_interrupt_handler[interrupt_number])->sharing_devices_count()) {
revert_to_unused_handler(interrupt_number);
}
return;
Expand Down
2 changes: 1 addition & 1 deletion Kernel/FileSystem/ProcFS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ Optional<KBuffer> procfs$interrupts(InodeIdentifier)
obj.add("purpose", "Interrupt Handler"); // FIXME: Determine the right description for each interrupt handler.
obj.add("interrupt_line", handler.interrupt_number());
obj.add("cpu_handler", 0); // FIXME: Determine the responsible CPU for each interrupt handler.
obj.add("device_sharing", (unsigned)handler.get_sharing_devices_count());
obj.add("device_sharing", (unsigned)handler.sharing_devices_count());
obj.add("call_count", (unsigned)handler.get_invoking_count());
});
array.finish();
Expand Down
2 changes: 1 addition & 1 deletion Kernel/Interrupts/GenericInterruptHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class GenericInterruptHandler {

size_t get_invoking_count() const { return m_invoking_count; }

virtual size_t get_sharing_devices_count() const = 0;
virtual size_t sharing_devices_count() const = 0;
virtual bool is_shared_handler() const = 0;
virtual bool is_sharing_with_others() const = 0;

Expand Down
2 changes: 1 addition & 1 deletion Kernel/Interrupts/IRQHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class IRQHandler : public GenericInterruptHandler {

virtual HandlerPurpose purpose() const override { return HandlerPurpose::IRQHandler; }

virtual size_t get_sharing_devices_count() const override { return 0; }
virtual size_t sharing_devices_count() const override { return 0; }
virtual bool is_shared_handler() const override { return false; }
virtual bool is_sharing_with_others() const override { return m_shared_with_others; }

Expand Down
2 changes: 1 addition & 1 deletion Kernel/Interrupts/MSIHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class MSIHandler : public GenericInterruptHandler {

virtual bool eoi() override;

virtual size_t get_sharing_devices_count() const override { return 0; }
virtual size_t sharing_devices_count() const override { return 0; }
virtual bool is_shared_handler() const override { return false; }
virtual bool is_sharing_with_others() const override { return m_shared_with_others; }

Expand Down
2 changes: 1 addition & 1 deletion Kernel/Interrupts/SharedIRQHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class SharedIRQHandler final : public GenericInterruptHandler {

virtual bool eoi() override;

virtual size_t get_sharing_devices_count() const override { return m_handlers.size(); }
virtual size_t sharing_devices_count() const override { return m_handlers.size(); }
virtual bool is_shared_handler() const override { return true; }
virtual bool is_sharing_with_others() const override { return false; }

Expand Down
2 changes: 1 addition & 1 deletion Kernel/Interrupts/UnhandledInterruptHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class UnhandledInterruptHandler final : public GenericInterruptHandler {

virtual HandlerPurpose purpose() const override { return HandlerPurpose::UnhandledInterruptHandler; }

virtual size_t get_sharing_devices_count() const override { return 0; }
virtual size_t sharing_devices_count() const override { return 0; }
virtual bool is_shared_handler() const override { return false; }
virtual bool is_sharing_with_others() const override { return false; }

Expand Down

0 comments on commit fe66496

Please sign in to comment.