[dpdk-dev,6/8] drivers/net/e1000/igb: Signed left shift operator

Message ID 1456426121-21423-7-git-send-email-aconole@redhat.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers

Commit Message

Aaron Conole Feb. 25, 2016, 6:48 p.m. UTC
  Tell the compiler to use an unsigned constant for the config shifts.

Signed-off-by: Aaron Conole <aconole@redhat.com>
---
 drivers/net/e1000/igb_pf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Panu Matilainen March 10, 2016, 1:29 p.m. UTC | #1
On 02/25/2016 08:48 PM, Aaron Conole wrote:
> Tell the compiler to use an unsigned constant for the config shifts.
>
> Signed-off-by: Aaron Conole <aconole@redhat.com>
> ---
>   drivers/net/e1000/igb_pf.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/e1000/igb_pf.c b/drivers/net/e1000/igb_pf.c
> index 1d00dda..afe80f5 100644
> --- a/drivers/net/e1000/igb_pf.c
> +++ b/drivers/net/e1000/igb_pf.c
> @@ -172,8 +172,8 @@ int igb_pf_host_configure(struct rte_eth_dev *eth_dev)
>   	E1000_WRITE_REG(hw, E1000_VT_CTL, vtctl);
>
>   	/* Enable pools reserved to PF only */
> -	E1000_WRITE_REG(hw, E1000_VFRE, (~0) << vf_num);
> -	E1000_WRITE_REG(hw, E1000_VFTE, (~0) << vf_num);
> +	E1000_WRITE_REG(hw, E1000_VFRE, (~0U) << vf_num);
> +	E1000_WRITE_REG(hw, E1000_VFTE, (~0U) << vf_num);
>
>   	/* PFDMA Tx General Switch Control Enables VMDQ loopback */
>   	if (hw->mac.type == e1000_i350)
>
Acked-by: Panu Matilainen <pmatilai@redhat.com>

CC'd the e1000 maintainer too.

	- Panu -
  
Zhang, Helin March 18, 2016, 12:54 a.m. UTC | #2
> -----Original Message-----
> From: Aaron Conole [mailto:aconole@redhat.com]
> Sent: Friday, February 26, 2016 2:49 AM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Zhang, Helin
> <helin.zhang@intel.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>; Richardson, Bruce
> <bruce.richardson@intel.com>
> Subject: [PATCH 6/8] drivers/net/e1000/igb: Signed left shift operator
> 
> Tell the compiler to use an unsigned constant for the config shifts.
> 
> Signed-off-by: Aaron Conole <aconole@redhat.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
> ---
>  drivers/net/e1000/igb_pf.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/e1000/igb_pf.c b/drivers/net/e1000/igb_pf.c index
> 1d00dda..afe80f5 100644
> --- a/drivers/net/e1000/igb_pf.c
> +++ b/drivers/net/e1000/igb_pf.c
> @@ -172,8 +172,8 @@ int igb_pf_host_configure(struct rte_eth_dev *eth_dev)
>  	E1000_WRITE_REG(hw, E1000_VT_CTL, vtctl);
> 
>  	/* Enable pools reserved to PF only */
> -	E1000_WRITE_REG(hw, E1000_VFRE, (~0) << vf_num);
> -	E1000_WRITE_REG(hw, E1000_VFTE, (~0) << vf_num);
> +	E1000_WRITE_REG(hw, E1000_VFRE, (~0U) << vf_num);
> +	E1000_WRITE_REG(hw, E1000_VFTE, (~0U) << vf_num);
> 
>  	/* PFDMA Tx General Switch Control Enables VMDQ loopback */
>  	if (hw->mac.type == e1000_i350)
> --
> 2.5.0
  

Patch

diff --git a/drivers/net/e1000/igb_pf.c b/drivers/net/e1000/igb_pf.c
index 1d00dda..afe80f5 100644
--- a/drivers/net/e1000/igb_pf.c
+++ b/drivers/net/e1000/igb_pf.c
@@ -172,8 +172,8 @@  int igb_pf_host_configure(struct rte_eth_dev *eth_dev)
 	E1000_WRITE_REG(hw, E1000_VT_CTL, vtctl);
 
 	/* Enable pools reserved to PF only */
-	E1000_WRITE_REG(hw, E1000_VFRE, (~0) << vf_num);
-	E1000_WRITE_REG(hw, E1000_VFTE, (~0) << vf_num);
+	E1000_WRITE_REG(hw, E1000_VFRE, (~0U) << vf_num);
+	E1000_WRITE_REG(hw, E1000_VFTE, (~0U) << vf_num);
 
 	/* PFDMA Tx General Switch Control Enables VMDQ loopback */
 	if (hw->mac.type == e1000_i350)