All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.e.keller@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH v1 02/13] ixgbe: resolve shift of negative value warning
Date: Wed, 13 Apr 2016 14:31:13 -0700	[thread overview]
Message-ID: <1460583084-16900-3-git-send-email-jacob.e.keller@intel.com> (raw)
In-Reply-To: <1460583084-16900-1-git-send-email-jacob.e.keller@intel.com>

Make use of GENMASK instead of open coding the equivalent operation
incorrectly.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 40145d3da457..b3dd1b6903d7 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -3767,9 +3767,9 @@ static void ixgbe_configure_virtualization(struct ixgbe_adapter *adapter)
 	reg_offset = (VMDQ_P(0) >= 32) ? 1 : 0;
 
 	/* Enable only the PF's pool for Tx/Rx */
-	IXGBE_WRITE_REG(hw, IXGBE_VFRE(reg_offset), (~0) << vf_shift);
+	IXGBE_WRITE_REG(hw, IXGBE_VFRE(reg_offset), GENMASK(vf_shift, 31));
 	IXGBE_WRITE_REG(hw, IXGBE_VFRE(reg_offset ^ 1), reg_offset - 1);
-	IXGBE_WRITE_REG(hw, IXGBE_VFTE(reg_offset), (~0) << vf_shift);
+	IXGBE_WRITE_REG(hw, IXGBE_VFTE(reg_offset), GENMASK(vf_shift, 31));
 	IXGBE_WRITE_REG(hw, IXGBE_VFTE(reg_offset ^ 1), reg_offset - 1);
 	if (adapter->bridge_mode == BRIDGE_MODE_VEB)
 		IXGBE_WRITE_REG(hw, IXGBE_PFDTXGSWC, IXGBE_PFDTXGSWC_VT_LBEN);
-- 
2.8.1.102.ga49ec4a


  parent reply	other threads:[~2016-04-13 21:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-13 21:31 [Intel-wired-lan] [PATCH v1 00/13] Fix several GCC6 warnings Jacob Keller
2016-04-13 21:31 ` [Intel-wired-lan] [PATCH v1 01/13] ixgbe: use BIT() macro Jacob Keller
2016-04-13 21:31 ` Jacob Keller [this message]
2016-04-13 21:31 ` [Intel-wired-lan] [PATCH v1 03/13] ixgbevf: make use of BIT() macro to avoid shift of signed values Jacob Keller
2016-04-13 21:39   ` Alexander Duyck
2016-04-13 21:47     ` Keller, Jacob E
2016-04-13 21:31 ` [Intel-wired-lan] [PATCH v1 04/13] i40e/i40evf: fix I40E_MASK signed shift overflow warnings Jacob Keller
2016-04-13 21:31 ` [Intel-wired-lan] [PATCH v1 05/13] i40e: make use of BIT() macro to prevent left shift of signed values Jacob Keller
2016-04-13 21:31 ` [Intel-wired-lan] [PATCH v1 06/13] i40evf: make use of BIT() macro to avoid signed left shift Jacob Keller
2016-04-13 21:31 ` [Intel-wired-lan] [PATCH v1 07/13] igb: use BIT() macro or unsigned prefix Jacob Keller
2016-04-13 21:31 ` [Intel-wired-lan] [PATCH v1 08/13] igb: make igb_update_pf_vlvf static Jacob Keller
2016-04-13 21:31 ` [Intel-wired-lan] [PATCH v1 09/13] igbvf: remove unused variable and dead code Jacob Keller
2016-04-13 21:31 ` [Intel-wired-lan] [PATCH v1 10/13] igbvf: use BIT() macro instead of shifts Jacob Keller
2016-04-13 21:44   ` Alexander Duyck
2016-04-13 21:31 ` [Intel-wired-lan] [PATCH v1 11/13] e1000e: use BIT() macro for bit defines Jacob Keller
2016-04-13 21:31 ` [Intel-wired-lan] [PATCH v1 12/13] e1000e: mark shifted values as unsigned Jacob Keller
2016-04-13 21:31 ` [Intel-wired-lan] [PATCH v1 13/13] e1000e: remove unused variable Jacob Keller
2016-04-13 21:39   ` Keller, Jacob E
2016-04-13 21:57 ` [Intel-wired-lan] [PATCH v1 00/13] Fix several GCC6 warnings Alexander Duyck
2016-04-13 22:32   ` Keller, Jacob E

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1460583084-16900-3-git-send-email-jacob.e.keller@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=intel-wired-lan@osuosl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.