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
This commit is contained in:
John Baldwin 2023-03-31 10:56:33 -07:00
parent e93da76b07
commit ad83dd2b2b
2 changed files with 2 additions and 1 deletions

View File

@ -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'; \
}

View File

@ -128,6 +128,7 @@ typedef struct {
} while (0)
#define spin_unlock_irqrestore(_l, flags) do { \
(void)(flags); \
spin_unlock(_l); \
} while (0)