From: akpm@linux-foundation.org
To: James.Bottomley@HansenPartnership.com
Cc: linux-scsi@vger.kernel.org, akpm@linux-foundation.org,
rdunlap@xenotime.net, megaraidlinux@lsi.com,
viro@ZenIV.linux.org.uk
Subject: [patch 2/6] drivers/scsi/megaraid.c: fix sparse warnings
Date: Tue, 15 Nov 2011 14:58:11 -0800 [thread overview]
Message-ID: <201111152258.pAFMwBbX007699@wpaz5.hot.corp.google.com> (raw)
From: Randy Dunlap <rdunlap@xenotime.net>
Subject: drivers/scsi/megaraid.c: fix sparse warnings
Fix sparse warnings of right shift bigger than source value size:
drivers/scsi/megaraid.c:311:65: warning: right shift by bigger than source value
drivers/scsi/megaraid.c:313:65: warning: right shift by bigger than source value
drivers/scsi/megaraid.c:317:67: warning: right shift by bigger than source value
drivers/scsi/megaraid.c:319:67: warning: right shift by bigger than source value
Patch suggestion from email by Al Viro:
"Since both are claimed to be strings, I really suspect that this >> 8 is
misspelled >> 4 and they have a character followed by pair of two-digit
packed decimals in there..."
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Neela Syam Kolli <megaraidlinux@lsi.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/scsi/megaraid.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff -puN drivers/scsi/megaraid.c~drivers-scsi-megaraidc-fix-sparse-warnings drivers/scsi/megaraid.c
--- a/drivers/scsi/megaraid.c~drivers-scsi-megaraidc-fix-sparse-warnings
+++ a/drivers/scsi/megaraid.c
@@ -310,15 +310,15 @@ mega_query_adapter(adapter_t *adapter)
if (adapter->product_info.subsysvid == HP_SUBSYS_VID) {
sprintf (adapter->fw_version, "%c%d%d.%d%d",
adapter->product_info.fw_version[2],
- adapter->product_info.fw_version[1] >> 8,
+ adapter->product_info.fw_version[1] >> 4,
adapter->product_info.fw_version[1] & 0x0f,
- adapter->product_info.fw_version[0] >> 8,
+ adapter->product_info.fw_version[0] >> 4,
adapter->product_info.fw_version[0] & 0x0f);
sprintf (adapter->bios_version, "%c%d%d.%d%d",
adapter->product_info.bios_version[2],
- adapter->product_info.bios_version[1] >> 8,
+ adapter->product_info.bios_version[1] >> 4,
adapter->product_info.bios_version[1] & 0x0f,
- adapter->product_info.bios_version[0] >> 8,
+ adapter->product_info.bios_version[0] >> 4,
adapter->product_info.bios_version[0] & 0x0f);
} else {
memcpy(adapter->fw_version,
_
next reply other threads:[~2011-11-15 23:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-15 22:58 akpm [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-01-10 23:42 [patch 2/6] drivers/scsi/megaraid.c: fix sparse warnings akpm
2012-01-11 1:18 ` adam radford
2012-01-11 1:25 ` James Bottomley
2012-01-11 1:48 ` Andrew Morton
2012-01-11 2:07 ` adam radford
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=201111152258.pAFMwBbX007699@wpaz5.hot.corp.google.com \
--to=akpm@linux-foundation.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=linux-scsi@vger.kernel.org \
--cc=megaraidlinux@lsi.com \
--cc=rdunlap@xenotime.net \
--cc=viro@ZenIV.linux.org.uk \
/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