linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
To: Adaptec OEM Raid Solutions <aacraid@adaptec.com>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>,
	linux-scsi@vger.kernel.org,
	Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Subject: [PATCH] scsi/aacraid: user upper/lower_address() macro to avoid "right shift count >= width of type" warning.
Date: Wed, 21 Nov 2012 21:50:21 +0100	[thread overview]
Message-ID: <1353531021-10410-1-git-send-email-sebastian@breakpoint.cc> (raw)

Avoids the following warning:
|drivers/scsi/aacraid/src.c: In function 'aac_src_deliver_message':
|drivers/scsi/aacraid/src.c:410:3: warning: right shift count >= width of type [enabled by default]
|    BUG_ON((u32)(address >> 32) != 0L);
|    ^
|drivers/scsi/aacraid/src.c:434:2: warning: right shift count >= width of type [enabled by default]
|   src_writel(dev, MUnit.IQ_H, (address >> 32) & 0xffffffff);

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
---
 drivers/scsi/aacraid/src.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/aacraid/src.c b/drivers/scsi/aacraid/src.c
index 3b021ec..4f6388e 100644
--- a/drivers/scsi/aacraid/src.c
+++ b/drivers/scsi/aacraid/src.c
@@ -407,7 +407,7 @@ static int aac_src_deliver_message(struct fib *fib)
 		fib->hw_fib_va->header.StructType = FIB_MAGIC2;
 		fib->hw_fib_va->header.SenderFibAddress = (u32)address;
 		fib->hw_fib_va->header.u.TimeStamp = 0;
-		BUG_ON((u32)(address >> 32) != 0L);
+		BUG_ON((upper_32_bits(address) != 0L));
 		address |= fibsize;
 	} else {
 		/* Calculate the amount to the fibsize bits */
@@ -431,8 +431,8 @@ static int aac_src_deliver_message(struct fib *fib)
 		address |= fibsize;
 	}
 
-	src_writel(dev, MUnit.IQ_H, (address >> 32) & 0xffffffff);
-	src_writel(dev, MUnit.IQ_L, address & 0xffffffff);
+	src_writel(dev, MUnit.IQ_H, upper_32_bits(address));
+	src_writel(dev, MUnit.IQ_L, lower_32_bits(address));
 
 	return 0;
 }
-- 
1.7.10.4


                 reply	other threads:[~2012-11-21 20:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1353531021-10410-1-git-send-email-sebastian@breakpoint.cc \
    --to=sebastian@breakpoint.cc \
    --cc=JBottomley@parallels.com \
    --cc=aacraid@adaptec.com \
    --cc=linux-scsi@vger.kernel.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 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).