[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1387490237-27260-1-git-send-email-dborkman@redhat.com>
Date: Thu, 19 Dec 2013 22:57:17 +0100
From: Daniel Borkmann <dborkman@...hat.com>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org, jeffrey.t.kirsher@...el.com
Subject: [PATCH net] net: i40e: fix shifting error in i40e_led_get
In function i40e_led_get(), we fetch the LED mode from the GPIO
registers and extract it from gpio_val. However, regardless of
the outcome of the fetched value in gpio_val, the calculation
to extract the mode will always be 0, as we do the following:
(gpio_val & (61440U /* 0xf << 12 */)) >> 17
Instead of I40E_GLGEN_GPIO_CTL_INT_MODE_SHIFT, we need to use
I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT to fix this.
Signed-off-by: Daniel Borkmann <dborkman@...hat.com>
---
Seems like this is still unfixed, so sending to netdev.
drivers/net/ethernet/intel/i40e/i40e_common.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 1e4ea13..a170761 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -365,8 +365,8 @@ u32 i40e_led_get(struct i40e_hw *hw)
if (port != hw->port)
continue;
- mode = (gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK)
- >> I40E_GLGEN_GPIO_CTL_INT_MODE_SHIFT;
+ mode = (gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) >>
+ I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT;
break;
}
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists