git: b8c3dd46bba0 - main - Fix gcc unused value warnings in FreeBSD zfs_prop.c
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 28 Oct 2024 17:35:18 UTC
The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=b8c3dd46bba0451cfecf2fcfbc6aff0459a487bd commit b8c3dd46bba0451cfecf2fcfbc6aff0459a487bd Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2024-10-27 14:15:54 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2024-10-28 17:34:58 +0000 Fix gcc unused value warnings in FreeBSD zfs_prop.c With gcc we are seeing the following -Werror warnings: /workspace/src/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd.h:53:33: error: statement with no effect [-Werror=unused-value] 53 | #define simd_stat_init() 0 | ^ /workspace/src/sys/contrib/openzfs/module/zcommon/zfs_prop.c:1092:9: note: in expansion of macro 'simd_stat_init' 1092 | simd_stat_init(); | ^~~~~~~~~~~~~~ /workspace/src/sys/contrib/openzfs/module/zcommon/zfs_prop.c: In function 'zcommon_fini': /workspace/src/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd.h:54:33: error: statement with no effect [-Werror=unused-value] 54 | #define simd_stat_fini() 0 | ^ /workspace/src/sys/contrib/openzfs/module/zcommon/zfs_prop.c:1100:9: note: in expansion of macro 'simd_stat_fini' 1100 | simd_stat_fini(); | ^~~~~~~~~~~~~~ Both `simd_stat_init()` and `simd_stat_fini()` are defined in the FreeBSD specific version of `simd.h`: #define simd_stat_init() 0 #define simd_stat_fini() 0 These should both be defined as `do {} while (0)` instead, similar to other macros in this file. Reviewed by: mav, tsoome (upstream) Obtained from: https://github.com/openzfs/zfs/pull/16693 MFC after: 3 days Differential Revision: <https://reviews.freebsd.org/D47297> --- sys/contrib/openzfs/include/os/freebsd/spl/sys/simd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd.h b/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd.h index 6bc46755c4e3..d16e1db5e826 100644 --- a/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd.h +++ b/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd.h @@ -50,7 +50,7 @@ #define kfpu_fini() do {} while (0) #endif -#define simd_stat_init() 0 -#define simd_stat_fini() 0 +#define simd_stat_init() do {} while (0) +#define simd_stat_fini() do {} while (0) #endif