netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>,
	Bruce Allan <bruce.w.allan@intel.com>,
	Carolyn Wyborny <carolyn.wyborny@intel.com>,
	Don Skidmore <donald.c.skidmore@intel.com>,
	Greg Rose <gregory.v.rose@intel.com>,
	Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>,
	Alex Duyck <alexander.h.duyck@intel.com>,
	John Ronciak <john.ronciak@intel.com>,
	Tushar Dave <tushar.n.dave@intel.com>,
	e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] i40e: Fix 32 bit shift compilation warnings
Date: Fri, 30 Aug 2013 18:47:35 -0700	[thread overview]
Message-ID: <1377913655.2070.45.camel@joe-AO722> (raw)
In-Reply-To: <daa992875a6f542adc41069daeb81246e46b7f80.1377903831.git.joe@perches.com>

When dma_addr_t is a 32 bit value, >> 32 emits compiler warnings
Use ((addr>>16) >>16) to avoid this.

I presume the macro should actually use the kernel.h
macro upper_32_bits() eventually.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/ethernet/intel/i40e/i40e_hmc.h  | 2 +-
 drivers/net/ethernet/intel/i40e/i40e_type.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_hmc.h b/drivers/net/ethernet/intel/i40e/i40e_hmc.h
index 745fb355..2f1b72f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_hmc.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_hmc.h
@@ -123,7 +123,7 @@ struct i40e_hmc_info {
 #define I40E_SET_PF_SD_ENTRY(hw, pa, sd_index, type)			\
 {									\
 	u32 val1, val2, val3;						\
-	val1 = (u32)((pa) >> sizeof(u32) * 8);				\
+	val1 = (u32)(I40E_HI_DWORD(pa));				\
 	val2 = (u32)(pa) | (I40E_HMC_MAX_BP_COUNT <<			\
 		 I40E_PFHMC_SDDATALOW_PMSDBPCOUNT_SHIFT) |		\
 		((((type) == I40E_SD_TYPE_PAGED) ? 0 : 1) <<		\
diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h
index 36e35cc..4263cf7 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h
@@ -78,8 +78,8 @@ typedef void (*I40E_ADMINQ_CALLBACK)(struct i40e_hw *, struct i40e_aq_desc *);
 #define I40E_ETH_LENGTH_OF_ADDRESS	6
 
 /* Data type manipulation macros. */
-#define I40E_HI_DWORD(x)	((u32)(((x)>>32)&0xFFFFFFFF))
-#define I40E_LO_DWORD(x)	((u32)((x)&0xFFFFFFFF))
+#define I40E_HI_DWORD(x)	((u32)((((x) >> 16) >> 16) & 0xFFFFFFFF))
+#define I40E_LO_DWORD(x)	((u32)((x) & 0xFFFFFFFF))
 
 #define I40E_HI_WORD(x)		((u16)(((x)>>16)&0xFFFF))
 #define I40E_DESC_UNUSED(R)	\

  reply	other threads:[~2013-08-31  1:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-30 23:06 [PATCH 0/4] i40e: Neatening and object size reductions Joe Perches
2013-08-30 23:06 ` [PATCH 1/4] i40e: Whitespace cleaning Joe Perches
2013-08-30 23:06 ` [PATCH 2/4] i40e: Add and use pf_<level> Joe Perches
2013-08-30 23:06 ` [PATCH 3/4] i40e: pf_<level> remove "%s: " ... __func__ Joe Perches
2013-08-30 23:06 ` [PATCH 4/4] i40e: Convert pf_<level> macros to functions Joe Perches
2013-08-31  1:47   ` Joe Perches [this message]
2013-08-31  2:12     ` [PATCH] i40e: Fix 32 bit shift compilation warnings Jeff Kirsher
2013-08-31 16:45     ` [E1000-devel] " Stephen Hemminger
2013-08-31  2:12 ` [PATCH 0/4] i40e: Neatening and object size reductions Jeff Kirsher
2013-09-04  1:00 ` [E1000-devel] " Nelson, Shannon
2013-09-04  1:30   ` Joe Perches
2013-09-04  1:38     ` Nelson, Shannon
2013-09-04  4:31   ` Joe Perches

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=1377913655.2070.45.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=alexander.h.duyck@intel.com \
    --cc=bruce.w.allan@intel.com \
    --cc=carolyn.wyborny@intel.com \
    --cc=donald.c.skidmore@intel.com \
    --cc=e1000-devel@lists.sourceforge.net \
    --cc=gregory.v.rose@intel.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=john.ronciak@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peter.p.waskiewicz.jr@intel.com \
    --cc=tushar.n.dave@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).