From: Randy Dunlap Date: Wed, 28 Sep 2011 00:49:48 +0000 (+1000) Subject: drivers/scsi/megaraid.c: fix sparse warnings X-Git-Tag: next-20110930~1^2~225 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=aff577d589b5a4706b2e73533eb30764d19b0de4;p=karo-tx-linux.git 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 Cc: Al Viro Cc: Neela Syam Kolli Cc: James Bottomley Signed-off-by: Andrew Morton <> --- diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 5c1776406c96..1408ebb49111 100644 --- a/drivers/scsi/megaraid.c +++ b/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,