Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Ben Collins <benmcollins13@gmail.com>
To: wfg@linux.intel.com
Cc: James Bottomley <JBottomley@Parallels.com>, linux-scsi@vger.kernel.org
Subject: Re: [scsi:pending 3/3] drivers/scsi/aacraid/src.c:425:2: warning: right shift count >= width of type
Date: Wed, 20 Jun 2012 12:52:11 -0500	[thread overview]
Message-ID: <69598C04-83AA-4F1F-AFB5-666838371CEF@gmail.com> (raw)
In-Reply-To: <9F0D52A8-D4E0-40C9-8619-6802A1378C16@ubuntu.com>


On Jun 20, 2012, at 12:44 PM, Ben Collins wrote:

> On Jun 20, 2012, at 12:12 PM, wfg@linux.intel.com wrote:
> 
>> Hi Ben,
>> 
>> There are new compile warnings show up in
>> 
>> tree:   git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git pending
>> head:   e766db42f45c7685fce5c0d48ba74eaa97e6d715
>> commit: e766db42f45c7685fce5c0d48ba74eaa97e6d715 [3/3] [SCSI] aacraid: Fix endian issues in core and SRC portions of driver
>> 
>> All warnings:
>> 
>> drivers/scsi/aacraid/src.c: In function 'aac_src_deliver_message':
>> drivers/scsi/aacraid/src.c:425:2: warning: right shift count >= width of type [enabled by default]
> 
> Hrmm, pretty innocuous, but I guess it could be rewritten as:
> 
> #if BITS_PER_LONG > 32
>         src_writel(dev, MUnit.IQ_H, (address >> 32) & 0xffffffff);
> #else
>         src_writel(dev, MUnit.IQ_H, 0);
> #endif

Actually, this is wrong too, since it's a dma_addr_t, not an unsigned long, so:

#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
        src_writel(dev, MUnit.IQ_H, (address >> 32) & 0xffffffff);
#else
        src_writel(dev, MUnit.IQ_H, 0);
#endif



> I'm assuming the compiler can optimize line 426 to skip the masking in such a case.
> 
>> drivers/scsi/aacraid/src.c:425:
>>  422		if (address & (ALIGN32 - 1))
>>  423			return -EINVAL;
>>  424		address |= fibsize;
>>> 425		src_writel(dev, MUnit.IQ_H, (address >> 32) & 0xffffffff);
>>  426		src_writel(dev, MUnit.IQ_L, address & 0xffffffff);
>>  427	
>>  428		return 0;
>> 
>> ---
>> 0-DAY kernel build testing backend         Open Source Technology Centre
>> Fengguang Wu <wfg@linux.intel.com>                     Intel Corporation
>> <0001-SCSI-aacraid-Fix-endian-issues-in-core-and-SRC-porti.patch><src.c>
> 
> --
> Bluecherry: http://www.bluecherrydvr.com/
> SwissDisk : http://www.swissdisk.com/
> Ubuntu    : http://www.ubuntu.com/
> My Blog   : http://ben-collins.blogspot.com/
> 

--
Bluecherry: http://www.bluecherrydvr.com/
SwissDisk : http://www.swissdisk.com/
Ubuntu    : http://www.ubuntu.com/
My Blog   : http://ben-collins.blogspot.com/


  reply	other threads:[~2012-06-20 17:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-20 17:12 [scsi:pending 3/3] drivers/scsi/aacraid/src.c:425:2: warning: right shift count >= width of type wfg
2012-06-20 17:44 ` Ben Collins
2012-06-20 17:52   ` Ben Collins [this message]
2012-06-20 18:02     ` James Bottomley
2012-06-20 19:58       ` Ben Collins

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=69598C04-83AA-4F1F-AFB5-666838371CEF@gmail.com \
    --to=benmcollins13@gmail.com \
    --cc=JBottomley@Parallels.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=wfg@linux.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