aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2023-03-31 17:56:33 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2023-03-31 17:56:33 +0000
commitad83dd2b2b6bb56c002a93fcf800b30f2ec448d5 (patch)
tree1bc4647e8943f435e2d45bd5a16d004d9af76630 /sys
parente93da76b073a9cf9e350d512fb43b60e96c0a47d (diff)
downloadsrc-ad83dd2b2b6bb56c002a93fcf800b30f2ec448d5.tar.gz
src-ad83dd2b2b6bb56c002a93fcf800b30f2ec448d5.zip
LinuxKPI: Appease -Wunused-but-set-variable warnings from GCC.
- Mark assert dummy variables as __unused. - Use a dummy (void) cast of the flags argument passed to spin_unlock_irqrestore so it gets treated as used. Reviewed by: manu, hselasky Differential Revision: https://reviews.freebsd.org/D39349
Diffstat (limited to 'sys')
-rw-r--r--sys/compat/linuxkpi/common/include/linux/kernel.h2
-rw-r--r--sys/compat/linuxkpi/common/include/linux/spinlock.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h
index 22b25a202395..4fd9f8613895 100644
--- a/sys/compat/linuxkpi/common/include/linux/kernel.h
+++ b/sys/compat/linuxkpi/common/include/linux/kernel.h
@@ -103,7 +103,7 @@
#define _O_CTASSERT(x) _O__CTASSERT(x, __LINE__)
#define _O__CTASSERT(x, y) _O___CTASSERT(x, y)
#define _O___CTASSERT(x, y) while (0) { \
- typedef char __assert_line_ ## y[(x) ? 1 : -1]; \
+ typedef char __unused __assert_line_ ## y[(x) ? 1 : -1]; \
__assert_line_ ## y _x; \
_x[0] = '\0'; \
}
diff --git a/sys/compat/linuxkpi/common/include/linux/spinlock.h b/sys/compat/linuxkpi/common/include/linux/spinlock.h
index a87cb7180b28..f72a295d2a40 100644
--- a/sys/compat/linuxkpi/common/include/linux/spinlock.h
+++ b/sys/compat/linuxkpi/common/include/linux/spinlock.h
@@ -128,6 +128,7 @@ typedef struct {
} while (0)
#define spin_unlock_irqrestore(_l, flags) do { \
+ (void)(flags); \
spin_unlock(_l); \
} while (0)