From d9276b6fb32ca6ebf142c21d89e73b21a94a29a9 Mon Sep 17 00:00:00 2001
From: Anjan Chanda <anjan.chanda@iopsys.eu>
Date: Thu, 3 Mar 2022 21:53:45 +0100
Subject: [PATCH] gitlab-ci: fix cppcheck errors, warnings and false-positives

---
 bcm/bcm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bcm/bcm.c b/bcm/bcm.c
index b507e25..e475dd0 100644
--- a/bcm/bcm.c
+++ b/bcm/bcm.c
@@ -76,7 +76,7 @@ static int bcm_eth_get_unit_port(const char *ifname, int *unit, int *port)
 		unsigned int portmap = data.port_map;
 
 		for (i = 0; i < 8 * sizeof(portmap); i++) {
-			if (!!(portmap & (1 << i))) {
+			if (!!(portmap & (1UL << i))) {
 				*port = i;
 				break;
 			}
@@ -293,7 +293,7 @@ static int read_eth_stats(const char *ifname, struct eth_stats *s)
 	memset(&data, 0, sizeof(struct ethswctl_data));
 	ret = bcm_eth_get_unit_port(ifname, &unit, &port);
 	if (ret)
-		return ret_proc == 0 ? 0 : -1;
+		return -1;
 
 	data.op = ETHSWEMACGET;
 	data.port = port;
@@ -304,7 +304,7 @@ static int read_eth_stats(const char *ifname, struct eth_stats *s)
 						sizeof(struct ethswctl_data));
 	if (ret != 0) {
 		libethernet_err("ioctl failed! ret = %d\n", ret);
-		return ret_proc == 0 ? 0 : -1;
+		return -1;
 	}
 
 	s->tx_bytes = data.emac_stats_s.tx_byte;
-- 
GitLab