summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/amd/xgbe
diff options
context:
space:
mode:
authorLendacky, Thomas <Thomas.Lendacky@amd.com>2016-11-14 23:39:16 +0100
committerDavid S. Miller <davem@davemloft.net>2016-11-16 04:12:57 +0100
commit8c5385cbb0361dd6538b5b422996c3f1e1c6989d (patch)
treeba4e9ca0a2cac27664f22de77977200a5a3b97bc /drivers/net/ethernet/amd/xgbe
parentamd-xgbe: Fix mask appliciation for Clause 37 register (diff)
downloadlinux-8c5385cbb0361dd6538b5b422996c3f1e1c6989d.tar.xz
linux-8c5385cbb0361dd6538b5b422996c3f1e1c6989d.zip
amd-xgbe: Fix up some coccinelle identified warnings
Fix up some warnings that were identified by coccinelle: Clean up an if/else block that can look confusing since the same statement is executed in an "else if" check and the final "else" statement. Change a variable from unsigned int to int since it is used in an if statement checking the value to be less than 0. Reported-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/amd/xgbe')
-rw-r--r--drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
index 4ba43328d99e..348cc8cf5e74 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
@@ -1766,8 +1766,6 @@ static void xgbe_phy_sfi_mode(struct xgbe_prv_data *pdata)
XP_SET_BITS(s0, XP_DRIVER_SCRATCH_0, SUB_COMMAND, 1);
else if (phy_data->sfp_cable_len <= 3)
XP_SET_BITS(s0, XP_DRIVER_SCRATCH_0, SUB_COMMAND, 2);
- else if (phy_data->sfp_cable_len <= 5)
- XP_SET_BITS(s0, XP_DRIVER_SCRATCH_0, SUB_COMMAND, 3);
else
XP_SET_BITS(s0, XP_DRIVER_SCRATCH_0, SUB_COMMAND, 3);
}
@@ -2346,7 +2344,8 @@ static bool xgbe_phy_valid_speed(struct xgbe_prv_data *pdata, int speed)
static int xgbe_phy_link_status(struct xgbe_prv_data *pdata, int *an_restart)
{
struct xgbe_phy_data *phy_data = pdata->phy_data;
- unsigned int ret, reg;
+ unsigned int reg;
+ int ret;
*an_restart = 0;