Blame SOURCES/0104-libmultipath-use-symbolic-value-for-invalid-pcentry.patch

c90e5b
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
c90e5b
From: Benjamin Marzinski <bmarzins@redhat.com>
c90e5b
Date: Thu, 14 Apr 2022 16:11:10 -0500
c90e5b
Subject: [PATCH] libmultipath: use symbolic value for invalid pcentry
c90e5b
c90e5b
Suggested-by: Martin Wilck <mwilck@suse.com>
c90e5b
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
c90e5b
Reviewed-by: Martin Wilck <mwilck@suse.com>
c90e5b
---
c90e5b
 libmultipath/config.c | 4 ++--
c90e5b
 libmultipath/config.h | 1 +
c90e5b
 2 files changed, 3 insertions(+), 2 deletions(-)
c90e5b
c90e5b
diff --git a/libmultipath/config.c b/libmultipath/config.c
c90e5b
index 88975323..bcd8b541 100644
c90e5b
--- a/libmultipath/config.c
c90e5b
+++ b/libmultipath/config.c
c90e5b
@@ -319,7 +319,7 @@ alloc_pce (void)
c90e5b
 {
c90e5b
 	struct pcentry *pce = (struct pcentry *)
c90e5b
 				calloc(1, sizeof(struct pcentry));
c90e5b
-	pce->type = -1;
c90e5b
+	pce->type = PCE_INVALID;
c90e5b
 	return pce;
c90e5b
 }
c90e5b
 
c90e5b
@@ -578,7 +578,7 @@ validate_pctable(struct hwentry *ovr, int idx, const char *table_desc)
c90e5b
 		return;
c90e5b
 
c90e5b
 	vector_foreach_slot_after(ovr->pctable, pce, idx) {
c90e5b
-		if (pce->type < 0) {
c90e5b
+		if (pce->type == PCE_INVALID) {
c90e5b
 			condlog(0, "protocol section in %s missing type",
c90e5b
 				table_desc);
c90e5b
 			vector_del_slot(ovr->pctable, idx--);
c90e5b
diff --git a/libmultipath/config.h b/libmultipath/config.h
c90e5b
index 143116b3..477f8bfa 100644
c90e5b
--- a/libmultipath/config.h
c90e5b
+++ b/libmultipath/config.h
c90e5b
@@ -41,6 +41,7 @@ enum force_reload_types {
c90e5b
 	FORCE_RELOAD_WEAK,
c90e5b
 };
c90e5b
 
c90e5b
+#define PCE_INVALID -1
c90e5b
 struct pcentry {
c90e5b
 	int type;
c90e5b
 	int fast_io_fail;