Blame SOURCES/0007-libmultipath-discovery.c-use-z-qualifier-for-size_t.patch

96a22b
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
96a22b
From: Martin Wilck <mwilck@suse.com>
96a22b
Date: Tue, 12 May 2020 00:39:25 +0200
96a22b
Subject: [PATCH] libmultipath: discovery.c: use %z qualifier for size_t
96a22b
96a22b
Otherwise compilation for 32bit targets spits out warnings.
96a22b
96a22b
Signed-off-by: Martin Wilck <mwilck@suse.com>
96a22b
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
96a22b
---
96a22b
 libmultipath/discovery.c | 16 ++++++++--------
96a22b
 1 file changed, 8 insertions(+), 8 deletions(-)
96a22b
96a22b
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
96a22b
index ee3290cd..ffec5162 100644
96a22b
--- a/libmultipath/discovery.c
96a22b
+++ b/libmultipath/discovery.c
96a22b
@@ -986,7 +986,7 @@ parse_vpd_pg80(const unsigned char *in, char *out, size_t out_len)
96a22b
 	}
96a22b
 
96a22b
 	if (len >= out_len) {
96a22b
-		condlog(2, "vpd pg80 overflow, %lu/%lu bytes required",
96a22b
+		condlog(2, "vpd pg80 overflow, %zu/%zu bytes required",
96a22b
 			len + 1, out_len);
96a22b
 		len = out_len - 1;
96a22b
 	}
96a22b
@@ -1087,7 +1087,7 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len,
96a22b
 
96a22b
 		len = sprintf(out, "%d", vpd_type);
96a22b
 		if (2 * vpd_len >= out_len - len) {
96a22b
-			condlog(1, "%s: WWID overflow, type %d, %lu/%lu bytes required",
96a22b
+			condlog(1, "%s: WWID overflow, type %d, %zu/%zu bytes required",
96a22b
 				__func__, vpd_type,
96a22b
 				2 * vpd_len + len + 1, out_len);
96a22b
 			vpd_len = (out_len - len - 1) / 2;
96a22b
@@ -1096,7 +1096,7 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len,
96a22b
 			len += sprintf(out + len,
96a22b
 				       "%02x", vpd[i]);
96a22b
 	} else if (vpd_type == 0x8 && vpd_len < 4) {
96a22b
-		condlog(1, "%s: VPD length %lu too small for designator type 8",
96a22b
+		condlog(1, "%s: VPD length %zu too small for designator type 8",
96a22b
 			__func__, vpd_len);
96a22b
 		return -EINVAL;
96a22b
 	} else if (vpd_type == 0x8) {
96a22b
@@ -1112,7 +1112,7 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len,
96a22b
 		while (len > 2 && vpd[len - 2] == '\0')
96a22b
 			--len;
96a22b
 		if (len > out_len - 1) {
96a22b
-			condlog(1, "%s: WWID overflow, type 8/%c, %lu/%lu bytes required",
96a22b
+			condlog(1, "%s: WWID overflow, type 8/%c, %zu/%zu bytes required",
96a22b
 				__func__, out[0], len + 1, out_len);
96a22b
 			len = out_len - 1;
96a22b
 		}
96a22b
@@ -1136,7 +1136,7 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len,
96a22b
 		while ((p = memchr(vpd, ' ', vpd_len))) {
96a22b
 			p_len = p - vpd;
96a22b
 			if (len + p_len > out_len - 1) {
96a22b
-				condlog(1, "%s: WWID overflow, type 1, %lu/%lu bytes required",
96a22b
+				condlog(1, "%s: WWID overflow, type 1, %zu/%zu bytes required",
96a22b
 					__func__, len + p_len, out_len);
96a22b
 				p_len = out_len - len - 1;
96a22b
 			}
96a22b
@@ -1162,7 +1162,7 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len,
96a22b
 		p_len = vpd_len;
96a22b
 		if (p_len > 0 && len < out_len - 1) {
96a22b
 			if (len + p_len > out_len - 1) {
96a22b
-				condlog(1, "%s: WWID overflow, type 1, %lu/%lu bytes required",
96a22b
+				condlog(1, "%s: WWID overflow, type 1, %zu/%zu bytes required",
96a22b
 					__func__, len + p_len + 1, out_len);
96a22b
 				p_len = out_len - len - 1;
96a22b
 			}
96a22b
@@ -1186,14 +1186,14 @@ parse_vpd_c0_hp3par(const unsigned char *in, size_t in_len,
96a22b
 
96a22b
 	memset(out, 0x0, out_len);
96a22b
 	if (in_len <= 4 || (in[4] > 3 && in_len < 44)) {
96a22b
-		condlog(3, "HP/3PAR vendor specific VPD page length too short: %lu", in_len);
96a22b
+		condlog(3, "HP/3PAR vendor specific VPD page length too short: %zu", in_len);
96a22b
 		return -EINVAL;
96a22b
 	}
96a22b
 	if (in[4] <= 3) /* revision must be > 3 to have Vomlume Name */
96a22b
 		return -ENODATA;
96a22b
 	len = get_unaligned_be32(&in[40]);
96a22b
 	if (len > out_len || len + 44 > in_len) {
96a22b
-		condlog(3, "HP/3PAR vendor specific Volume name too long: %lu",
96a22b
+		condlog(3, "HP/3PAR vendor specific Volume name too long: %zu",
96a22b
 			len);
96a22b
 		return -EINVAL;
96a22b
 	}
96a22b
-- 
96a22b
2.17.2
96a22b