Blame SOURCES/0008-get-rid-of-signed-unsigned-comparison-warnings-in-re.patch

4f6fcd
From a76ac50c3049b7fa77f71828c4e0a3569eea626d Mon Sep 17 00:00:00 2001
4f6fcd
From: Michal Kubecek <mkubecek@suse.cz>
4f6fcd
Date: Sun, 23 Aug 2020 21:40:33 +0200
4f6fcd
Subject: [PATCH 08/17] get rid of signed/unsigned comparison warnings in
4f6fcd
 register dump parsers
4f6fcd
4f6fcd
All of these are avoided by declaring a variable (mostly loop iterators)
4f6fcd
holding only unsigned values as unsigned.
4f6fcd
4f6fcd
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
4f6fcd
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
4f6fcd
(cherry picked from commit 16c87d0a03757958d857d7054bd296bfc74c6d39)
4f6fcd
---
4f6fcd
 dsa.c      | 2 +-
4f6fcd
 fec.c      | 2 +-
4f6fcd
 ibm_emac.c | 2 +-
4f6fcd
 marvell.c  | 2 +-
4f6fcd
 natsemi.c  | 2 +-
4f6fcd
 rxclass.c  | 8 +++++---
4f6fcd
 sfpdiag.c  | 2 +-
4f6fcd
 tg3.c      | 4 ++--
4f6fcd
 8 files changed, 13 insertions(+), 11 deletions(-)
4f6fcd
4f6fcd
diff --git a/dsa.c b/dsa.c
4f6fcd
index 65502a899194..33c1d39d6605 100644
4f6fcd
--- a/dsa.c
4f6fcd
+++ b/dsa.c
4f6fcd
@@ -824,8 +824,8 @@ static int dsa_mv88e6xxx_dump_regs(struct ethtool_regs *regs)
4f6fcd
 {
4f6fcd
 	const struct dsa_mv88e6xxx_switch *sw = NULL;
4f6fcd
 	const u16 *data = (u16 *)regs->data;
4f6fcd
+	unsigned int i;
4f6fcd
 	u16 id;
4f6fcd
-	int i;
4f6fcd
 
4f6fcd
 	/* Marvell chips have 32 per-port 16-bit registers */
4f6fcd
 	if (regs->len < 32 * sizeof(u16))
4f6fcd
diff --git a/fec.c b/fec.c
4f6fcd
index 9cb4f8b1d4e1..d2373d6124c0 100644
4f6fcd
--- a/fec.c
4f6fcd
+++ b/fec.c
4f6fcd
@@ -198,7 +198,7 @@ int fec_dump_regs(struct ethtool_drvinfo *info __maybe_unused,
4f6fcd
 		  struct ethtool_regs *regs)
4f6fcd
 {
4f6fcd
 	const u32 *data = (u32 *)regs->data;
4f6fcd
-	int offset;
4f6fcd
+	unsigned int offset;
4f6fcd
 	u32 val;
4f6fcd
 
4f6fcd
 	for (offset = 0; offset < regs->len; offset += 4) {
4f6fcd
diff --git a/ibm_emac.c b/ibm_emac.c
4f6fcd
index ea01d56f609c..9f7cae605482 100644
4f6fcd
--- a/ibm_emac.c
4f6fcd
+++ b/ibm_emac.c
4f6fcd
@@ -238,7 +238,7 @@ static void *print_mal_regs(void *buf)
4f6fcd
 {
4f6fcd
 	struct emac_ethtool_regs_subhdr *hdr = buf;
4f6fcd
 	struct mal_regs *p = (struct mal_regs *)(hdr + 1);
4f6fcd
-	int i;
4f6fcd
+	unsigned int i;
4f6fcd
 
4f6fcd
 	printf("MAL%d Registers\n", hdr->index);
4f6fcd
 	printf("-----------------\n");
4f6fcd
diff --git a/marvell.c b/marvell.c
4f6fcd
index 8afb150327a3..d3d570e4d4ad 100644
4f6fcd
--- a/marvell.c
4f6fcd
+++ b/marvell.c
4f6fcd
@@ -130,7 +130,7 @@ static void dump_fifo(const char *name, const void *p)
4f6fcd
 static void dump_gmac_fifo(const char *name, const void *p)
4f6fcd
 {
4f6fcd
 	const u32 *r = p;
4f6fcd
-	int i;
4f6fcd
+	unsigned int i;
4f6fcd
 	static const char *regs[] = {
4f6fcd
 		"End Address",
4f6fcd
 		"Almost Full Thresh",
4f6fcd
diff --git a/natsemi.c b/natsemi.c
4f6fcd
index 0af465959cbc..4d9fc092b623 100644
4f6fcd
--- a/natsemi.c
4f6fcd
+++ b/natsemi.c
4f6fcd
@@ -967,8 +967,8 @@ int
4f6fcd
 natsemi_dump_eeprom(struct ethtool_drvinfo *info __maybe_unused,
4f6fcd
 		    struct ethtool_eeprom *ee)
4f6fcd
 {
4f6fcd
-	int i;
4f6fcd
 	u16 *eebuf = (u16 *)ee->data;
4f6fcd
+	unsigned int i;
4f6fcd
 
4f6fcd
 	if (ee->magic != NATSEMI_MAGIC) {
4f6fcd
 		fprintf(stderr, "Magic number 0x%08x does not match 0x%08x\n",
4f6fcd
diff --git a/rxclass.c b/rxclass.c
4f6fcd
index 79972651e706..6cf81fdafc85 100644
4f6fcd
--- a/rxclass.c
4f6fcd
+++ b/rxclass.c
4f6fcd
@@ -348,8 +348,9 @@ int rxclass_rule_getall(struct cmd_context *ctx)
4f6fcd
 {
4f6fcd
 	struct ethtool_rxnfc *nfccmd;
4f6fcd
 	__u32 *rule_locs;
4f6fcd
-	int err, i;
4f6fcd
+	unsigned int i;
4f6fcd
 	__u32 count;
4f6fcd
+	int err;
4f6fcd
 
4f6fcd
 	/* determine rule count */
4f6fcd
 	err = rxclass_get_dev_info(ctx, &count, NULL);
4f6fcd
@@ -481,8 +482,9 @@ static int rmgr_find_empty_slot(struct rmgr_ctrl *rmgr,
4f6fcd
 static int rmgr_init(struct cmd_context *ctx, struct rmgr_ctrl *rmgr)
4f6fcd
 {
4f6fcd
 	struct ethtool_rxnfc *nfccmd;
4f6fcd
-	int err, i;
4f6fcd
 	__u32 *rule_locs;
4f6fcd
+	unsigned int i;
4f6fcd
+	int err;
4f6fcd
 
4f6fcd
 	/* clear rule manager settings */
4f6fcd
 	memset(rmgr, 0, sizeof(*rmgr));
4f6fcd
@@ -941,7 +943,7 @@ static int rxclass_get_long(char *str, long long *val, int size)
4f6fcd
 
4f6fcd
 static int rxclass_get_ulong(char *str, unsigned long long *val, int size)
4f6fcd
 {
4f6fcd
-	long long max = ~0ULL >> (64 - size);
4f6fcd
+	unsigned long long max = ~0ULL >> (64 - size);
4f6fcd
 	char *endp;
4f6fcd
 
4f6fcd
 	errno = 0;
4f6fcd
diff --git a/sfpdiag.c b/sfpdiag.c
4f6fcd
index fa41651422ea..1fa8b7ba8fec 100644
4f6fcd
--- a/sfpdiag.c
4f6fcd
+++ b/sfpdiag.c
4f6fcd
@@ -190,8 +190,8 @@ static float befloattoh(const __u32 *source)
4f6fcd
 
4f6fcd
 static void sff8472_calibration(const __u8 *id, struct sff_diags *sd)
4f6fcd
 {
4f6fcd
-	int i;
4f6fcd
 	__u16 rx_reading;
4f6fcd
+	unsigned int i;
4f6fcd
 
4f6fcd
 	/* Calibration should occur for all values (threshold and current) */
4f6fcd
 	for (i = 0; i < ARRAY_SIZE(sd->bias_cur); ++i) {
4f6fcd
diff --git a/tg3.c b/tg3.c
4f6fcd
index ac73b33ae4e3..ebdef2d60e6b 100644
4f6fcd
--- a/tg3.c
4f6fcd
+++ b/tg3.c
4f6fcd
@@ -7,7 +7,7 @@
4f6fcd
 int tg3_dump_eeprom(struct ethtool_drvinfo *info __maybe_unused,
4f6fcd
 		    struct ethtool_eeprom *ee)
4f6fcd
 {
4f6fcd
-	int i;
4f6fcd
+	unsigned int i;
4f6fcd
 
4f6fcd
 	if (ee->magic != TG3_MAGIC) {
4f6fcd
 		fprintf(stderr, "Magic number 0x%08x does not match 0x%08x\n",
4f6fcd
@@ -26,7 +26,7 @@ int tg3_dump_eeprom(struct ethtool_drvinfo *info __maybe_unused,
4f6fcd
 int tg3_dump_regs(struct ethtool_drvinfo *info __maybe_unused,
4f6fcd
 		  struct ethtool_regs *regs)
4f6fcd
 {
4f6fcd
-	int i;
4f6fcd
+	unsigned int i;
4f6fcd
 	u32 reg;
4f6fcd
 
4f6fcd
 	fprintf(stdout, "Offset\tValue\n");
4f6fcd
-- 
4f6fcd
2.26.2
4f6fcd