aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2021-10-20 13:23:30 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2021-10-20 18:29:49 +0000
commit2ff7c2cc4f28ab05caccb2936ba0d74c6734dd39 (patch)
tree70c190df4175a9b239aa4f9a4128f30357caf617
parent2bd6d910b24343f7678be7482a78fd7d596e6753 (diff)
downloadsrc-2ff7c2cc4f28ab05caccb2936ba0d74c6734dd39.tar.gz
src-2ff7c2cc4f28ab05caccb2936ba0d74c6734dd39.zip
sys/bus.h: silence warnings about write-only variables
in the generated functions for bus accessors. These are the most noising instances for drivers when non-debug kernel is compiled with clang 13. Reviewed by: imp Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32578
-rw-r--r--sys/sys/bus.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/sys/bus.h b/sys/sys/bus.h
index bf51bdbef387..8544aa32cff8 100644
--- a/sys/sys/bus.h
+++ b/sys/sys/bus.h
@@ -805,7 +805,7 @@ DECLARE_MODULE(name##_##busname, name##_##busname##_mod, \
static __inline type varp ## _get_ ## var(device_t dev) \
{ \
uintptr_t v; \
- int e; \
+ int e __diagused; \
e = BUS_READ_IVAR(device_get_parent(dev), dev, \
ivarp ## _IVAR_ ## ivar, &v); \
KASSERT(e == 0, ("%s failed for %s on bus %s, error = %d", \
@@ -817,7 +817,7 @@ static __inline type varp ## _get_ ## var(device_t dev) \
static __inline void varp ## _set_ ## var(device_t dev, type t) \
{ \
uintptr_t v = (uintptr_t) t; \
- int e; \
+ int e __diagused; \
e = BUS_WRITE_IVAR(device_get_parent(dev), dev, \
ivarp ## _IVAR_ ## ivar, v); \
KASSERT(e == 0, ("%s failed for %s on bus %s, error = %d", \