FreeBSD: get_zfs_ioctl_version() should be cast to (void)

FreeBSD's Coverity scans complain that we ignore the return value. There
is no need to check the return value so we cast it to (void) to suppress
further complaints by static analyzers.

Reported-by: Coverity (CID 1018175)
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: szubersk <szuberskidamian@gmail.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #14136
This commit is contained in:
Richard Yao 2022-11-03 13:58:38 -04:00 committed by Brian Behlendorf
parent 9e7fc5da38
commit 31247c78b1

View file

@ -38,7 +38,7 @@ get_zfs_ioctl_version(void)
int ver = ZFS_IOCVER_NONE;
ver_size = sizeof (ver);
sysctlbyname("vfs.zfs.version.ioctl", &ver, &ver_size, NULL, 0);
(void) sysctlbyname("vfs.zfs.version.ioctl", &ver, &ver_size, NULL, 0);
return (ver);
}