1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:47:34 +00:00

Kernel: Remove redundant [[nodiscard]] on KResult return values

Both KResult and KResultOr are [[nodiscard]] at the class level,
so there's no need to have functions return `[[nodiscard]] KResult`.
This commit is contained in:
Andreas Kling 2021-09-06 22:25:02 +02:00
parent e6929835d2
commit 4b4e1d1c90
8 changed files with 21 additions and 21 deletions

View file

@ -54,7 +54,7 @@ public:
return offset_buffer;
}
[[nodiscard]] KResultOr<NonnullOwnPtr<KString>> try_copy_into_kstring(size_t) const;
KResultOr<NonnullOwnPtr<KString>> try_copy_into_kstring(size_t) const;
[[nodiscard]] bool write(const void* src, size_t offset, size_t len);
[[nodiscard]] bool write(const void* src, size_t len)
{
@ -82,7 +82,7 @@ public:
}
template<size_t BUFFER_BYTES, typename F>
[[nodiscard]] KResultOr<size_t> write_buffered(size_t offset, size_t len, F f)
KResultOr<size_t> write_buffered(size_t offset, size_t len, F f)
{
if (!m_buffer)
return EFAULT;
@ -113,13 +113,13 @@ public:
return nwritten;
}
template<size_t BUFFER_BYTES, typename F>
[[nodiscard]] KResultOr<size_t> write_buffered(size_t len, F f)
KResultOr<size_t> write_buffered(size_t len, F f)
{
return write_buffered<BUFFER_BYTES, F>(0, len, f);
}
template<size_t BUFFER_BYTES, typename F>
[[nodiscard]] KResultOr<size_t> read_buffered(size_t offset, size_t len, F f) const
KResultOr<size_t> read_buffered(size_t offset, size_t len, F f) const
{
if (!m_buffer)
return EFAULT;
@ -149,7 +149,7 @@ public:
return nread;
}
template<size_t BUFFER_BYTES, typename F>
[[nodiscard]] KResultOr<size_t> read_buffered(size_t len, F f) const
KResultOr<size_t> read_buffered(size_t len, F f) const
{
return read_buffered<BUFFER_BYTES, F>(0, len, f);
}