Suggested-by: Martin Wilck <mwi...@suse.com>
Signed-off-by: Benjamin Marzinski <bmarz...@redhat.com>
---
 libmultipath/config.c | 4 ++--
 libmultipath/config.h | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libmultipath/config.c b/libmultipath/config.c
index c3cfa119..54c28d24 100644
--- a/libmultipath/config.c
+++ b/libmultipath/config.c
@@ -383,7 +383,7 @@ alloc_pce (void)
 {
        struct pcentry *pce = (struct pcentry *)
                                calloc(1, sizeof(struct pcentry));
-       pce->type = -1;
+       pce->type = PCE_INVALID;
        return pce;
 }
 
@@ -642,7 +642,7 @@ validate_pctable(struct hwentry *ovr, int idx, const char 
*table_desc)
                return;
 
        vector_foreach_slot_after(ovr->pctable, pce, idx) {
-               if (pce->type < 0) {
+               if (pce->type == PCE_INVALID) {
                        condlog(0, "protocol section in %s missing type",
                                table_desc);
                        vector_del_slot(ovr->pctable, idx--);
diff --git a/libmultipath/config.h b/libmultipath/config.h
index 4f1a18a1..45cf9b35 100644
--- a/libmultipath/config.h
+++ b/libmultipath/config.h
@@ -40,6 +40,7 @@ enum force_reload_types {
        FORCE_RELOAD_WEAK,
 };
 
+#define PCE_INVALID -1
 struct pcentry {
        int type;
        int fast_io_fail;
-- 
2.17.2

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel

Reply via email to