From: Jingoo Han <jg1.han@samsung.com>
To: 'James Bottomley' <JBottomley@Parallels.com>
Cc: 'Oliver Neukum' <oliver@neukum.org>,
'Ali Akcaagac' <aliakc@web.de>,
'Jamie Lenehan' <lenehan@twibble.org>,
dc395x@twibble.org, 'James Bottomley' <jejb@kernel.org>,
linux-scsi@vger.kernel.org, Jingoo Han <jg1.han@samsung.com>
Subject: [PATCH 3/8] [SCSI] dc395x: use NULL instead of 0
Date: Wed, 07 Aug 2013 12:55:24 +0900 [thread overview]
Message-ID: <001301ce9321$f2157760$d6406620$@samsung.com> (raw)
%p is used, thus NULL should be used instead of 0.
Also, bit maskings are added in order to fix the following
sparse warnings:
drivers/scsi/dc395x.c:1525:17: warning: Using plain integer as NULL pointer
drivers/scsi/dc395x.c:4186:48: warning: cast truncates bits from constant value (1de1 becomes e1)
drivers/scsi/dc395x.c:4188:45: warning: cast truncates bits from constant value (391 becomes 91)
drivers/scsi/dc395x.c:4192:44: warning: cast truncates bits from constant value (1de1 becomes e1)
drivers/scsi/dc395x.c:4194:44: warning: cast truncates bits from constant value (391 becomes 91)
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/scsi/dc395x.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c
index e73445b..3b09c16 100644
--- a/drivers/scsi/dc395x.c
+++ b/drivers/scsi/dc395x.c
@@ -1526,7 +1526,7 @@ static u8 start_scsi(struct AdapterCtlBlk* acb, struct DeviceCtlBlk* dcb,
"command while another command (0x%p) is active.",
srb->cmd,
acb->active_dcb->active_srb ?
- acb->active_dcb->active_srb->cmd : 0);
+ acb->active_dcb->active_srb->cmd : NULL);
return 1;
}
if (DC395x_read16(acb, TRM_S1040_SCSI_STATUS) & SCSIINTERRUPT) {
@@ -4183,15 +4183,17 @@ static void check_eeprom(struct NvRamType *eeprom, unsigned long io_port)
*/
dprintkl(KERN_WARNING,
"EEProm checksum error: using default values and options.\n");
- eeprom->sub_vendor_id[0] = (u8)PCI_VENDOR_ID_TEKRAM;
+ eeprom->sub_vendor_id[0] = (u8)(PCI_VENDOR_ID_TEKRAM & 0xff);
eeprom->sub_vendor_id[1] = (u8)(PCI_VENDOR_ID_TEKRAM >> 8);
- eeprom->sub_sys_id[0] = (u8)PCI_DEVICE_ID_TEKRAM_TRMS1040;
+ eeprom->sub_sys_id[0] =
+ (u8)(PCI_DEVICE_ID_TEKRAM_TRMS1040 & 0xff);
eeprom->sub_sys_id[1] =
(u8)(PCI_DEVICE_ID_TEKRAM_TRMS1040 >> 8);
eeprom->sub_class = 0x00;
- eeprom->vendor_id[0] = (u8)PCI_VENDOR_ID_TEKRAM;
+ eeprom->vendor_id[0] = (u8)(PCI_VENDOR_ID_TEKRAM & 0xff);
eeprom->vendor_id[1] = (u8)(PCI_VENDOR_ID_TEKRAM >> 8);
- eeprom->device_id[0] = (u8)PCI_DEVICE_ID_TEKRAM_TRMS1040;
+ eeprom->device_id[0] =
+ (u8)(PCI_DEVICE_ID_TEKRAM_TRMS1040 & 0xff);
eeprom->device_id[1] =
(u8)(PCI_DEVICE_ID_TEKRAM_TRMS1040 >> 8);
eeprom->reserved = 0x00;
--
1.7.10.4
next reply other threads:[~2013-08-07 3:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-07 3:55 Jingoo Han [this message]
2013-08-07 6:50 ` [PATCH 3/8] [SCSI] dc395x: use NULL instead of 0 Oliver Neukum
2013-08-07 6:58 ` Jingoo Han
2013-08-07 10:14 ` Oliver Neukum
2013-08-07 7:45 ` Jingoo Han
2013-08-07 8:20 ` Julian Calaby
2013-08-07 8:36 ` Jingoo Han
2013-08-07 8:39 ` Julian Calaby
2013-08-07 8:51 ` Jingoo Han
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='001301ce9321$f2157760$d6406620$@samsung.com' \
--to=jg1.han@samsung.com \
--cc=JBottomley@Parallels.com \
--cc=aliakc@web.de \
--cc=dc395x@twibble.org \
--cc=jejb@kernel.org \
--cc=lenehan@twibble.org \
--cc=linux-scsi@vger.kernel.org \
--cc=oliver@neukum.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.