mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-24 21:45:20 +00:00
Kernel: Annotate more AsyncDeviceRequest API's with [[nodiscard]]
This commit is contained in:
parent
033b287635
commit
ce5a308f24
Notes:
sideshowbarker
2024-07-18 19:17:44 +09:00
Author: https://github.com/bgianfo Commit: https://github.com/SerenityOS/serenity/commit/ce5a308f24f Pull-request: https://github.com/SerenityOS/serenity/pull/6509 Reviewed-by: https://github.com/alimpfard
1 changed files with 3 additions and 3 deletions
|
@ -45,7 +45,7 @@ class AsyncDeviceRequest : public RefCounted<AsyncDeviceRequest> {
|
|||
AK_MAKE_NONMOVABLE(AsyncDeviceRequest);
|
||||
|
||||
public:
|
||||
enum RequestResult {
|
||||
enum [[nodiscard]] RequestResult {
|
||||
Pending = 0,
|
||||
Started,
|
||||
Success,
|
||||
|
@ -145,14 +145,14 @@ private:
|
|||
void sub_request_finished(AsyncDeviceRequest&);
|
||||
void request_finished();
|
||||
|
||||
bool in_target_context(const UserOrKernelBuffer& buffer) const
|
||||
[[nodiscard]] bool in_target_context(const UserOrKernelBuffer& buffer) const
|
||||
{
|
||||
if (buffer.is_kernel_buffer())
|
||||
return true;
|
||||
return m_process == Process::current();
|
||||
}
|
||||
|
||||
static bool is_completed_result(RequestResult result)
|
||||
[[nodiscard]] static bool is_completed_result(RequestResult result)
|
||||
{
|
||||
return result > Started;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue