git: e726e7105685 - main - Suppress unused variable warning for zfs_fm.c

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Tue, 26 Jul 2022 20:10:04 UTC
The branch main has been updated by dim:

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

commit e726e7105685f99b066fcc3908c07157599cd290
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-07-26 20:07:42 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-07-26 20:08:14 +0000

    Suppress unused variable warning for zfs_fm.c
    
    With clang 15, the following -Werror warning is produced:
    
        sys/contrib/openzfs/module/zfs/zfs_fm.c:256:6: error: variable 'cnt' set but not used [-Werror,-Wunused-but-set-variable]
                int cnt = 0;
                    ^
    
    The 'cnt' variable does not seem to be used for anything, but since this
    is contributed code, suppress the warning instead.
    
    MFC after:      3 days
---
 sys/conf/files           | 2 +-
 sys/modules/zfs/Makefile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/conf/files b/sys/conf/files
index c1d91886ff05..0bfd6c147203 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -350,7 +350,7 @@ contrib/openzfs/module/zfs/zcp_synctask.c		optional zfs compile-with "${ZFS_C}"
 contrib/openzfs/module/zfs/zfeature.c		optional zfs compile-with "${ZFS_C}"
 contrib/openzfs/module/zfs/zfs_byteswap.c		optional zfs compile-with "${ZFS_C}"
 contrib/openzfs/module/zfs/zfs_chksum.c		optional zfs compile-with "${ZFS_C}"
-contrib/openzfs/module/zfs/zfs_fm.c		optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zfs_fm.c		optional zfs compile-with "${ZFS_C} ${NO_WUNUSED_BUT_SET_VARIABLE}"
 contrib/openzfs/module/zfs/zfs_fuid.c		optional zfs compile-with "${ZFS_C}"
 contrib/openzfs/module/zfs/zfs_ioctl.c		optional zfs compile-with "${ZFS_C}"
 contrib/openzfs/module/zfs/zfs_log.c		optional zfs compile-with "${ZFS_C}"
diff --git a/sys/modules/zfs/Makefile b/sys/modules/zfs/Makefile
index 9f54e60f6026..2c931e19a0d6 100644
--- a/sys/modules/zfs/Makefile
+++ b/sys/modules/zfs/Makefile
@@ -388,7 +388,7 @@ CFLAGS.vdev_raidz_math_sse2.c= -Wno-cast-qual -Wno-duplicate-decl-specifier
 CFLAGS.zap_leaf.c= -Wno-cast-qual
 CFLAGS.zap_micro.c= -Wno-cast-qual
 CFLAGS.zcp.c= -Wno-cast-qual
-CFLAGS.zfs_fm.c= -Wno-cast-qual
+CFLAGS.zfs_fm.c= -Wno-cast-qual ${NO_WUNUSED_BUT_SET_VARIABLE}
 CFLAGS.zfs_ioctl.c= -Wno-cast-qual
 CFLAGS.zil.c= -Wno-cast-qual
 CFLAGS.zio.c= -Wno-cast-qual