]> git.proxmox.com Git - mirror_zfs.git/commit
OpenZFS 8652 - Tautological comparisons with ZPROP_INVAL
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 19 Jan 2018 17:22:37 +0000 (09:22 -0800)
committerGitHub <noreply@github.com>
Fri, 19 Jan 2018 17:22:37 +0000 (09:22 -0800)
commit31864e3d8c9fc762d4c30324d9a061f4ed009446
treeaa46e0178efcbd829a3d83a4a9531d4495d45b5a
parent1574c73bd0680cf3141e26627191120daba3fe8d
OpenZFS 8652 - Tautological comparisons with ZPROP_INVAL

usr/src/uts/common/sys/fs/zfs.h
Change ZPROP_INVAL and ZPROP_CONT from macros to enum values.  Clang
and GCC both prefer to use unsigned ints to store enums.  That was
causing tautological comparison warnings (and likely eliminating
error handling code at compile time) whenever a zfs_prop_t or
zpool_prop_t was compared to ZPROP_INVAL or ZPROP_CONT.  Making the
error flags be explicity enum values forces the enum types to be
signed.

ZPROP_INVAL was also compared against two different enum types.  I
had to change its name to ZPOOL_PROP_INVAL whenever its compared to
a zpool_prop_t.  There are still some places where ZPROP_INVAL or
ZPROP_CONT is compared to a plain int, in code that doesn't know
whether the int is storing a zfs_prop_t or a zpool_prop_t.

usr/src/uts/common/fs/zfs/spa.c
s/ZPROP_INVAL/ZPOOL_PROP_INVAL/

Authored by: Alan Somers <asomers@gmail.com>
Approved by: Gordon Ross <gwr@nexenta.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Reviewed by: George Melikov <mail@gmelikov.ru>
Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
OpenZFS-issue: https://www.illumos.org/issues/8652
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/c2de80dc74
Closes #7061
cmd/zpool/zpool_main.c
include/sys/fs/zfs.h
lib/libzfs/libzfs_pool.c
module/zfs/spa.c