[dpdk-dev,04/31] net/i40e/base: fix bit test mask

Message ID 1480727953-92137-5-git-send-email-jingjing.wu@intel.com (mailing list archive)
State Changes Requested, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
checkpatch/checkpatch success coding style OK

Commit Message

Jingjing Wu Dec. 3, 2016, 1:18 a.m. UTC
  Incorrect bit mask was used for testing "get link status" response.
Instead of I40E_AQ_LSE_ENABLE (which is actually 0x03) it most probably
should be I40E_AQ_LSE_IS_ENABLED (which is defined as 0x01).

Fixes: 8db9e2a1b232 ("i40e: base driver")
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
---
 drivers/net/i40e/base/i40e_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Ferruh Yigit Dec. 5, 2016, 2:37 p.m. UTC | #1
On 12/3/2016 1:18 AM, Jingjing Wu wrote:
> Incorrect bit mask was used for testing "get link status" response.
> Instead of I40E_AQ_LSE_ENABLE (which is actually 0x03) it most probably

most probably J

> should be I40E_AQ_LSE_IS_ENABLED (which is defined as 0x01).
> 
> Fixes: 8db9e2a1b232 ("i40e: base driver")

This is detail, but defined syntax requires an empty line between
"Fixes" tag and "Signed-off-by" tag. You will see
/scripts/check-git-log.sh complain about it.

> Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
> ---
>  drivers/net/i40e/base/i40e_common.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c
> index aa346d1..a2661cf 100644
> --- a/drivers/net/i40e/base/i40e_common.c
> +++ b/drivers/net/i40e/base/i40e_common.c
> @@ -1975,7 +1975,7 @@ enum i40e_status_code i40e_aq_get_link_info(struct i40e_hw *hw,
>  	else
>  		hw_link_info->crc_enable = false;
>  
> -	if (resp->command_flags & CPU_TO_LE16(I40E_AQ_LSE_ENABLE))
> +	if (resp->command_flags & CPU_TO_LE16(I40E_AQ_LSE_IS_ENABLED))
>  		hw_link_info->lse_enable = true;
>  	else
>  		hw_link_info->lse_enable = false;
>
  

Patch

diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c
index aa346d1..a2661cf 100644
--- a/drivers/net/i40e/base/i40e_common.c
+++ b/drivers/net/i40e/base/i40e_common.c
@@ -1975,7 +1975,7 @@  enum i40e_status_code i40e_aq_get_link_info(struct i40e_hw *hw,
 	else
 		hw_link_info->crc_enable = false;
 
-	if (resp->command_flags & CPU_TO_LE16(I40E_AQ_LSE_ENABLE))
+	if (resp->command_flags & CPU_TO_LE16(I40E_AQ_LSE_IS_ENABLED))
 		hw_link_info->lse_enable = true;
 	else
 		hw_link_info->lse_enable = false;