diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-07-26 02:52:16 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-07-26 02:52:16 +0200 |
| commit | cbae92965caf0653e8f32794db3ab4173b54504d (patch) | |
| tree | 895209f76b2300bd92b2ae40c602a8fb8470d373 /kernel/kapi/devices/driver_registry.tests.cpp | |
| parent | 59f54d012c71e782966e9d083f1ee9459fd3fd70 (diff) | |
| download | kernel-cbae92965caf0653e8f32794db3ab4173b54504d.tar.xz kernel-cbae92965caf0653e8f32794db3ab4173b54504d.zip | |
chore: minor cleanups after refactoring
Diffstat (limited to 'kernel/kapi/devices/driver_registry.tests.cpp')
| -rw-r--r-- | kernel/kapi/devices/driver_registry.tests.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/kernel/kapi/devices/driver_registry.tests.cpp b/kernel/kapi/devices/driver_registry.tests.cpp index c7d1744d..7375bd4d 100644 --- a/kernel/kapi/devices/driver_registry.tests.cpp +++ b/kernel/kapi/devices/driver_registry.tests.cpp @@ -13,11 +13,11 @@ namespace { - struct test_identification + struct test_claim { constexpr auto static id = kapi::capabilities::facet_id{"test_identification"}; - virtual ~test_identification() = default; + virtual ~test_claim() = default; [[nodiscard]] virtual auto priority() const noexcept -> std::uint32_t = 0; [[nodiscard]] virtual auto probe_succeeds() const noexcept -> bool = 0; @@ -38,7 +38,7 @@ namespace { ++*match_calls; - auto const * identification = driver.facet<test_identification>(); + auto const * identification = driver.facet<test_claim>(); if (!identification) { return kstd::failure(kapi::devices::driver_match_errc::no_match); @@ -54,14 +54,14 @@ namespace { using kapi::devices::bus::bus; - [[nodiscard]] auto query_facet(kapi::capabilities::facet_id id) -> void * override + [[nodiscard]] auto query_facet(kapi::capabilities::facet_id facet) -> void * override { - if (id == test_protocol::id || id == kapi::devices::bus_protocol::id) + if (facet == kapi::devices::bus_protocol::id) { - return &bus_protocol; + return static_cast<kapi::devices::bus_protocol *>(&bus_protocol); } - return kapi::devices::bus::query_facet(id); + return kapi::devices::bus::query_facet(facet); } unsigned match_calls{}; @@ -73,7 +73,7 @@ namespace using kapi::devices::device::device; }; - struct test_driver final : kapi::devices::driver, test_identification + struct test_driver final : kapi::devices::driver, test_claim { test_driver(std::uint32_t priority, bool probe_succeeds) : probe_calls{} @@ -115,9 +115,9 @@ namespace protected: auto query_facet(kapi::capabilities::facet_id facet) -> void * override { - if (facet == test_identification::id) + if (facet == test_claim::id) { - return static_cast<test_identification *>(this); + return static_cast<test_claim *>(this); } return kapi::devices::driver::query_facet(facet); |
