* [PATCH net-next v2 0/2] amd-xgbe: AMD XGBE driver updates 2016-11-14
@ 2016-11-14 22:38 Tom Lendacky
2016-11-14 22:39 ` [PATCH net-next v2 1/2] amd-xgbe: Fix mask appliciation for Clause 37 register Tom Lendacky
2016-11-14 22:39 ` [PATCH net-next v2 2/2] amd-xgbe: Fix up some coccinelle identified warnings Tom Lendacky
0 siblings, 2 replies; 3+ messages in thread
From: Tom Lendacky @ 2016-11-14 22:38 UTC (permalink / raw)
To: netdev; +Cc: julia.lawall, christophe.jaillet, David Miller
(Resending with net-next in the subject)
This patch series addresses some minor issues found in the recently
accepted patch series for the AMD XGBE driver.
The following fixes are included in this driver update series:
- Fix how a mask is applied to a Clause 37 register value
- Fix some coccinelle identified warnings
This patch series is based on net-next.
---
Tom Lendacky (2):
amd-xgbe: Fix mask appliciation for Clause 37 register
amd-xgbe: Fix up some coccinelle identified warnings
drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 4 ++--
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 5 ++---
2 files changed, 4 insertions(+), 5 deletions(-)
--
Tom Lendacky
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH net-next v2 1/2] amd-xgbe: Fix mask appliciation for Clause 37 register 2016-11-14 22:38 [PATCH net-next v2 0/2] amd-xgbe: AMD XGBE driver updates 2016-11-14 Tom Lendacky @ 2016-11-14 22:39 ` Tom Lendacky 2016-11-14 22:39 ` [PATCH net-next v2 2/2] amd-xgbe: Fix up some coccinelle identified warnings Tom Lendacky 1 sibling, 0 replies; 3+ messages in thread From: Tom Lendacky @ 2016-11-14 22:39 UTC (permalink / raw) To: netdev; +Cc: julia.lawall, christophe.jaillet, David Miller The application of a mask to clear an area of a clause 37 register value was not properly applied. Update the code to do the proper application of the mask. Reported-by: Marion & Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> --- drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c index 0ecae70..4c5b90e 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c @@ -943,8 +943,8 @@ static void xgbe_an37_init(struct xgbe_prv_data *pdata) /* Set up the Control register */ reg = XMDIO_READ(pdata, MDIO_MMD_VEND2, MDIO_VEND2_AN_CTRL); - reg &= XGBE_AN_CL37_TX_CONFIG_MASK; - reg &= XGBE_AN_CL37_PCS_MODE_MASK; + reg &= ~XGBE_AN_CL37_TX_CONFIG_MASK; + reg &= ~XGBE_AN_CL37_PCS_MODE_MASK; switch (pdata->an_mode) { case XGBE_AN_MODE_CL37: ^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH net-next v2 2/2] amd-xgbe: Fix up some coccinelle identified warnings 2016-11-14 22:38 [PATCH net-next v2 0/2] amd-xgbe: AMD XGBE driver updates 2016-11-14 Tom Lendacky 2016-11-14 22:39 ` [PATCH net-next v2 1/2] amd-xgbe: Fix mask appliciation for Clause 37 register Tom Lendacky @ 2016-11-14 22:39 ` Tom Lendacky 1 sibling, 0 replies; 3+ messages in thread From: Tom Lendacky @ 2016-11-14 22:39 UTC (permalink / raw) To: netdev; +Cc: julia.lawall, christophe.jaillet, David Miller 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> --- drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 5 ++--- 1 file 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 4ba4332..348cc8c 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; ^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-11-14 22:39 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-11-14 22:38 [PATCH net-next v2 0/2] amd-xgbe: AMD XGBE driver updates 2016-11-14 Tom Lendacky 2016-11-14 22:39 ` [PATCH net-next v2 1/2] amd-xgbe: Fix mask appliciation for Clause 37 register Tom Lendacky 2016-11-14 22:39 ` [PATCH net-next v2 2/2] amd-xgbe: Fix up some coccinelle identified warnings Tom Lendacky
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox