git: 26e90d2d2892 - stable/14 - Fix statement with no effect in linuxkpi's xarray.h

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Wed, 23 Sep 2026 10:24:48 UTC
The branch stable/14 has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=26e90d2d2892fc9dd07fc7e9c5c342a77c337934

commit 26e90d2d2892fc9dd07fc7e9c5c342a77c337934
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2026-09-18 07:07:46 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2026-09-23 10:18:09 +0000

    Fix statement with no effect in linuxkpi's xarray.h
    
    When compiling the kernel with gcc 14, errors similar to the following
    are emitted:
    
      sys/dev/cxgbe/iw_cxgbe/ev.c: In function 'c4iw_ev_handler':
      sys/compat/linuxkpi/common/include/linux/xarray.h:132:23: error: statement with no effect [-Werror=unused-value]
        132 |                 flags == 0; \
      sys/dev/cxgbe/iw_cxgbe/ev.c:274:17: note: in expansion of macro 'xa_unlock_irqrestore'
        274 |                 xa_unlock_irqrestore(&dev->cqs, flag);
            |                 ^~~~~~~~~~~~~~~~~~~~
      sys/compat/linuxkpi/common/include/linux/xarray.h:132:23: error: statement with no effect [-Werror=unused-value]
        132 |                 flags == 0; \
      sys/dev/cxgbe/iw_cxgbe/ev.c:283:17: note: in expansion of macro 'xa_unlock_irqrestore'
        283 |                 xa_unlock_irqrestore(&dev->cqs, flag);
            |                 ^~~~~~~~~~~~~~~~~~~~
    
    It looks like the intent of the "flags == 0" statement was to make the
    'flags' macro argument not unused, but it still results in a warning.
    Use the construct "(void)flags" instead.
    
    Reviewed by:    bz
    MFC after:      3 days
    Differential Revision: https://reviews.freebsd.org/D59787
    
    (cherry picked from commit aca53fc2a6879f45dcbe1a60f91f14a5f6d48448)
---
 sys/compat/linuxkpi/common/include/linux/xarray.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/xarray.h b/sys/compat/linuxkpi/common/include/linux/xarray.h
index d293a8f7c2a3..4b015bf00c73 100644
--- a/sys/compat/linuxkpi/common/include/linux/xarray.h
+++ b/sys/compat/linuxkpi/common/include/linux/xarray.h
@@ -107,7 +107,7 @@ void *__xa_next(struct xarray *, unsigned long *, bool);
 #define	xa_unlock_irqrestore(xa, flags) \
 	do { \
 		xa_unlock((xa)); \
-		flags == 0; \
+		(void)flags; \
 	} while (0)
 
 static inline int