Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Dec 2020 16:54:59 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r368305 - head/sys/dev/axgbe
Message-ID:  <202012031654.0B3Gsx7j002768@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Thu Dec  3 16:54:59 2020
New Revision: 368305
URL: https://svnweb.freebsd.org/changeset/base/368305

Log:
  [axgbe] Fix compiler warnings in gcc-6.3; perhaps fix a PHY issue
  
  * uninitialised variable use
  * Using AXGBE_SET_ADV() where it was intended; using AXGBE_ADV()
    seems wrong and also causes a compiler warning.
  
  Reviewed by:	rpokala
  Differential Revision:	  https://reviews.freebsd.org/D26839

Modified:
  head/sys/dev/axgbe/xgbe-dev.c
  head/sys/dev/axgbe/xgbe-mdio.c
  head/sys/dev/axgbe/xgbe-phy-v2.c

Modified: head/sys/dev/axgbe/xgbe-dev.c
==============================================================================
--- head/sys/dev/axgbe/xgbe-dev.c	Thu Dec  3 15:55:07 2020	(r368304)
+++ head/sys/dev/axgbe/xgbe-dev.c	Thu Dec  3 16:54:59 2020	(r368305)
@@ -1337,7 +1337,7 @@ xgbe_dev_read(struct xgbe_channel *channel)
 	struct xgbe_ring_data *rdata;
 	struct xgbe_ring_desc *rdesc;
 	struct xgbe_packet_data *packet = &ring->packet_data;
-	unsigned int err, etlt, l34t;
+	unsigned int err, etlt, l34t = 0;
 
 	axgbe_printf(1, "-->xgbe_dev_read: cur = %d\n", ring->cur);
 

Modified: head/sys/dev/axgbe/xgbe-mdio.c
==============================================================================
--- head/sys/dev/axgbe/xgbe-mdio.c	Thu Dec  3 15:55:07 2020	(r368304)
+++ head/sys/dev/axgbe/xgbe-mdio.c	Thu Dec  3 16:54:59 2020	(r368305)
@@ -1186,7 +1186,7 @@ static int
 __xgbe_phy_config_aneg(struct xgbe_prv_data *pdata, bool set_mode)
 {
 	int ret;
-	unsigned int reg;
+	unsigned int reg = 0;
 
 	sx_xlock(&pdata->an_mutex);
 

Modified: head/sys/dev/axgbe/xgbe-phy-v2.c
==============================================================================
--- head/sys/dev/axgbe/xgbe-phy-v2.c	Thu Dec  3 15:55:07 2020	(r368304)
+++ head/sys/dev/axgbe/xgbe-phy-v2.c	Thu Dec  3 16:54:59 2020	(r368305)
@@ -2706,7 +2706,7 @@ xgbe_upd_link(struct xgbe_prv_data *pdata)
 static int
 xgbe_phy_read_status(struct xgbe_prv_data *pdata)
 {
-	int common_adv_gb;
+	int common_adv_gb = 0;
 	int common_adv;
 	int lpagb = 0;
 	int adv, lpa;
@@ -2741,9 +2741,9 @@ xgbe_phy_read_status(struct xgbe_prv_data *pdata)
 			}
 
 			if (pdata->phy.supported == SUPPORTED_1000baseT_Half) 
-				XGBE_ADV(&pdata->phy, 1000baseT_Half); 
+				XGBE_SET_ADV(&pdata->phy, 1000baseT_Half); 
 			else if (pdata->phy.supported == SUPPORTED_1000baseT_Full) 
-				XGBE_ADV(&pdata->phy, 1000baseT_Full); 
+				XGBE_SET_ADV(&pdata->phy, 1000baseT_Full); 
 
 			common_adv_gb = lpagb & adv << 2;
 		}
@@ -2753,7 +2753,7 @@ xgbe_phy_read_status(struct xgbe_prv_data *pdata)
 			return (lpa);
 
 		if (pdata->phy.supported == SUPPORTED_Autoneg) 
-			XGBE_ADV(&pdata->phy, Autoneg);
+			XGBE_SET_ADV(&pdata->phy, Autoneg);
  
 		adv = xgbe_phy_mii_read(pdata, pdata->mdio_addr, MII_ANAR);
 		if (adv < 0)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202012031654.0B3Gsx7j002768>