aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2026-06-26 16:42:06 +0000
committerBrooks Davis <brooks@FreeBSD.org>2026-06-26 16:42:06 +0000
commitb207b1562a2f099b4e763460891fa6761549091a (patch)
tree93a9fbd12a5885934d6276d595c4d7e74b1eec6f
parent2515e3f6776a3f95c888be5e58b28df0ffbe3dd8 (diff)
sys/systm.h: use __nodiscard consistently and correctly
__nodiscard is closer to (and sometimes expands to) [[nodiscard]] from C23 and C++17 so prefer it to the homegrown __result_use_check and put it in the right place so it is correct when expanded to [[nodiscard]]. Reviewed by: markj, emaste Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D57882
-rw-r--r--sys/sys/systm.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/sys/systm.h b/sys/sys/systm.h
index 88c25f06e0cb..e50b02bfb7cf 100644
--- a/sys/sys/systm.h
+++ b/sys/sys/systm.h
@@ -300,12 +300,12 @@ void *memmove_early(void * _Nonnull dest, const void * _Nonnull src, size_t n);
((__r >= __len) ? ENAMETOOLONG : 0); \
})
-int __result_use_check copyinstr(const void * __restrict udaddr,
+__nodiscard int copyinstr(const void * __restrict udaddr,
void * _Nonnull __restrict kaddr, size_t len,
size_t * __restrict lencopied);
-int __result_use_check copyin(const void * __restrict udaddr,
+__nodiscard int copyin(const void * __restrict udaddr,
void * _Nonnull __restrict kaddr, size_t len);
-int __result_use_check copyin_nofault(const void * __restrict udaddr,
+__nodiscard int copyin_nofault(const void * __restrict udaddr,
void * _Nonnull __restrict kaddr, size_t len);
__nodiscard int copyout(const void * _Nonnull __restrict kaddr,
void * __restrict udaddr, size_t len);
@@ -329,9 +329,9 @@ long fuword(volatile const void *base);
int fuword16(volatile const void *base);
int32_t fuword32(volatile const void *base);
int64_t fuword64(volatile const void *base);
-int __result_use_check fueword(volatile const void *base, long *val);
-int __result_use_check fueword32(volatile const void *base, int32_t *val);
-int __result_use_check fueword64(volatile const void *base, int64_t *val);
+__nodiscard int fueword(volatile const void *base, long *val);
+__nodiscard int fueword32(volatile const void *base, int32_t *val);
+__nodiscard int fueword64(volatile const void *base, int64_t *val);
__nodiscard int subyte(volatile void *base, int byte);
__nodiscard int suword(volatile void *base, long word);
__nodiscard int suword16(volatile void *base, int word);