diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-09-03 13:38:00 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-09-03 13:38:00 +0200 |
| commit | 79ef6855eb38edd03b51d2f5a2f614cdd7b9fcf1 (patch) | |
| tree | 3767eb424ac533e5df91b0f0f23755b46238b44d /kapi | |
| parent | de85ad8d0558d0950506a7e64e7a5f2d48dc8485 (diff) | |
| download | kernel-79ef6855eb38edd03b51d2f5a2f614cdd7b9fcf1.tar.xz kernel-79ef6855eb38edd03b51d2f5a2f614cdd7b9fcf1.zip | |
chore: add missing [[nodiscard]] attributes
Diffstat (limited to 'kapi')
| -rw-r--r-- | kapi/kapi/devices/facet_registry.hpp | 9 | ||||
| -rw-r--r-- | kapi/kapi/devices/power.hpp | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/kapi/kapi/devices/facet_registry.hpp b/kapi/kapi/devices/facet_registry.hpp index 7006c026..3c405923 100644 --- a/kapi/kapi/devices/facet_registry.hpp +++ b/kapi/kapi/devices/facet_registry.hpp @@ -150,7 +150,7 @@ namespace kapi::devices //! @param device The device to publish the facet for. //! @param name A stable name for the device. template<typename FacetType> - auto publish(kstd::shared_ptr<device> device, kstd::string name) -> kstd::result<void> + [[nodiscard]] auto publish(kstd::shared_ptr<device> device, kstd::string name) -> kstd::result<void> { if (!device) { @@ -172,7 +172,8 @@ namespace kapi::devices //! @param name A stable name for the device. //! @param facet The implementation of the facet for the device. template<typename FacetType> - auto publish(kstd::shared_ptr<device> device, kstd::string name, FacetType * facet) -> kstd::result<void> + [[nodiscard]] auto publish(kstd::shared_ptr<device> device, kstd::string name, FacetType * facet) + -> kstd::result<void> { return do_publish(device, std::move(name), FacetType::id, facet); } @@ -254,8 +255,8 @@ namespace kapi::devices //! @param name A stable name for the device. //! @param id The id of the facet to be published for the device. //! @param facet The facet of the device. - auto do_publish(kstd::shared_ptr<device> device, kstd::string name, kapi::capabilities::facet_id id, void * facet) - -> kstd::result<void>; + [[nodiscard]] auto do_publish(kstd::shared_ptr<device> device, kstd::string name, kapi::capabilities::facet_id id, + void * facet) -> kstd::result<void>; //! Notify all subscribed observers about a new facet having been published for a device. //! diff --git a/kapi/kapi/devices/power.hpp b/kapi/kapi/devices/power.hpp index 44837a65..a87ebc78 100644 --- a/kapi/kapi/devices/power.hpp +++ b/kapi/kapi/devices/power.hpp @@ -21,7 +21,7 @@ namespace kapi::devices //! //! @param root The root of the tree to suspend. //! @return nothing on success, the first error to occur otherwise. - auto suspend_tree(bus & root) -> kstd::result<void>; + [[nodiscard]] auto suspend_tree(bus & root) -> kstd::result<void>; //! Resume a device (sub-)tree rooted in a given bus. //! |
