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

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