Skip to contentSkip to conversation

net/octeneontx: fix warnings

PATCH Applied Stephen Hemminger 3 participants 3 messages Apr 5, 2018 – Apr 6, 2018 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/octeneontx: fix warnings

This is fix for Coverity Devect 268319 about uninitialized speed in an error case. Also drop unnecessary assignment.

---
 drivers/net/octeontx/octeontx_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/octeontx/octeontx_ethdev.c +1 -1
index 90dd249a6b84..ec3438cb1941 100644
@@ -518,7 +518,6 @@ octeontx_dev_link_update(struct rte_eth_dev *dev,
 	struct rte_eth_link link;
 	int res;
 
-	res = 0;
 	PMD_INIT_FUNC_TRACE();
 
 	res = octeontx_port_link_status(nic);
@@ -552,6 +551,7 @@ octeontx_dev_link_update(struct rte_eth_dev *dev,
 	case OCTEONTX_LINK_SPEED_RESERVE1:
 	case OCTEONTX_LINK_SPEED_RESERVE2:
 	default:
+		link.link_speed = ETH_SPEED_NUM_NONE;
 		octeontx_log_err("incorrect link speed %d", nic->speed);
 		break;
 	}
Signature · 1 line
2.16.3
Acked-by on v1 1/1
#1 lore raw

-----Original Message-----

Quoted 8 lines

Date: Thu, 5 Apr 2018 08:12:28 -0700
From: Stephen Hemminger <[email protected]>
To: [email protected]
Cc: [email protected], Stephen Hemminger <[email protected]>
Subject: [PATCH] net/octeneontx: fix warnings
X-Mailer: git-send-email 2.16.3

This is fix for Coverity Devect 268319 about uninitialized speed

s/Devect/defect

Quoted 1 line

in an error case. Also drop unnecessary assignment.

Coverity issue: 268319

Fixes 4fac7c0a147e ("net/octeontx: add link update")

with above changes in the commit log:

Quoted 29 lines
---
 drivers/net/octeontx/octeontx_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/octeontx/octeontx_ethdev.c +1 -1
index 90dd249a6b84..ec3438cb1941 100644
@@ -518,7 +518,6 @@ octeontx_dev_link_update(struct rte_eth_dev *dev,
 	struct rte_eth_link link;
 	int res;
 
-	res = 0;
 	PMD_INIT_FUNC_TRACE();
 
 	res = octeontx_port_link_status(nic);
@@ -552,6 +551,7 @@ octeontx_dev_link_update(struct rte_eth_dev *dev,
 	case OCTEONTX_LINK_SPEED_RESERVE1:
 	case OCTEONTX_LINK_SPEED_RESERVE2:
 	default:
+		link.link_speed = ETH_SPEED_NUM_NONE;
 		octeontx_log_err("incorrect link speed %d", nic->speed);
 		break;
 	}
Signature · 1 line
2.16.3
Applied
#2 lore raw
Quoted 15 lines · Jerin Jacob

-----Original Message-----

Quoted 8 lines

Date: Thu, 5 Apr 2018 08:12:28 -0700
From: Stephen Hemminger <[email protected]>
To: [email protected]
Cc: [email protected], Stephen Hemminger <[email protected]>
Subject: [PATCH] net/octeneontx: fix warnings
X-Mailer: git-send-email 2.16.3

This is fix for Coverity Devect 268319 about uninitialized speed

s/Devect/defect

Quoted 1 line

in an error case. Also drop unnecessary assignment.

Coverity issue: 268319

Quoted 8 lines
Fixes 4fac7c0a147e ("net/octeontx: add link update")
Quoted 1 line

Applied to dpdk-next-net/master, thanks.

(with suggested commit log updates)