From 6ae47a1fe04296eba06fcde0af4e89e100c6eb76 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sat, 22 Mar 2025 06:48:11 +0100 Subject: kernel(PCI): Let compare UInt8 (UChar) with PciDeviceKind in Database.h Applied the patch to Iterator.cc. Signed-off-by: Amlal El Mahrouss --- dev/Kernel/HALKit/AMD64/PCI/Iterator.cc | 2 +- dev/Kernel/KernelKit/PCI/Database.h | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'dev') diff --git a/dev/Kernel/HALKit/AMD64/PCI/Iterator.cc b/dev/Kernel/HALKit/AMD64/PCI/Iterator.cc index 9758e021..bf215fe2 100644 --- a/dev/Kernel/HALKit/AMD64/PCI/Iterator.cc +++ b/dev/Kernel/HALKit/AMD64/PCI/Iterator.cc @@ -19,7 +19,7 @@ namespace NeOS::PCI { Device dev(bus, device, function, 0x00); - if (dev.Class() == (UChar)type) + if (dev.Class() == type) { fDevices[bus] = dev; } diff --git a/dev/Kernel/KernelKit/PCI/Database.h b/dev/Kernel/KernelKit/PCI/Database.h index 82f38d33..cb12a731 100644 --- a/dev/Kernel/KernelKit/PCI/Database.h +++ b/dev/Kernel/KernelKit/PCI/Database.h @@ -36,3 +36,23 @@ namespace NeOS }; } // namespace Types } // namespace NeOS + +inline BOOL operator!=(const NeOS::Types::PciDeviceKind& lhs, NeOS::UChar rhs) +{ + return rhs != (NeOS::UChar)lhs; +} + +inline BOOL operator==(const NeOS::Types::PciDeviceKind& lhs, NeOS::UChar rhs) +{ + return rhs == (NeOS::UChar)lhs; +} + +inline BOOL operator!=(NeOS::UChar lhs, const NeOS::Types::PciDeviceKind& rhs) +{ + return lhs != (NeOS::UChar)rhs; +} + +inline BOOL operator==(NeOS::UChar lhs, const NeOS::Types::PciDeviceKind& rhs) +{ + return lhs == (NeOS::UChar)rhs; +} \ No newline at end of file -- cgit v1.2.3