[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
This commit is contained in:
Adrian Chadd 2020-12-03 16:54:59 +00:00
parent 67b94fc58e
commit 94e3e7d2e8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=368305
3 changed files with 6 additions and 6 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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)