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

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