summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorakpm@osdl.org <akpm@osdl.org>2006-04-15 00:30:24 -0700
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-04-15 09:04:40 -0500
commitc5f2e6404c65e8380c9ba80a7d58a27d2642743b (patch)
treea8af59f4cd7154032ac35486586babe73467b3c9 /drivers
parentcdb8c2a6d848deb9eeefffff42974478fbb51b8c (diff)
downloadop-kernel-dev-c5f2e6404c65e8380c9ba80a7d58a27d2642743b.zip
op-kernel-dev-c5f2e6404c65e8380c9ba80a7d58a27d2642743b.tar.gz
[SCSI] scsi_scan.c: fix compile warnings
drivers/scsi/scsi_scan.c: In function `scsi_probe_and_add_lun': drivers/scsi/scsi_scan.c:926: warning: unused variable `vend' drivers/scsi/scsi_scan.c:926: warning: unused variable `mod' drivers/scsi/scsi_scan.c: At top level: drivers/scsi/scsi_scan.c:829: warning: `scsi_inq_str' defined but not used Fix those, tighten up the (somewhat poorly-designed) logging macro and fix some coding-style warts. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/scsi_logging.h8
-rw-r--r--drivers/scsi/scsi_scan.c19
2 files changed, 18 insertions, 9 deletions
diff --git a/drivers/scsi/scsi_logging.h b/drivers/scsi/scsi_logging.h
index e1722ba..a3e2af6 100644
--- a/drivers/scsi/scsi_logging.h
+++ b/drivers/scsi/scsi_logging.h
@@ -45,10 +45,12 @@ extern unsigned int scsi_logging_level;
((scsi_logging_level >> (SHIFT)) & ((1 << (BITS)) - 1))
#define SCSI_CHECK_LOGGING(SHIFT, BITS, LEVEL, CMD) \
-{ \
+do { \
if (unlikely((SCSI_LOG_LEVEL(SHIFT, BITS)) > (LEVEL))) \
- (CMD); \
-}
+ do { \
+ CMD; \
+ } while (0); \
+} while (0)
#else
#define SCSI_CHECK_LOGGING(SHIFT, BITS, LEVEL, CMD)
#endif /* CONFIG_SCSI_LOGGING */
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 5c7e51f..f85d910 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -816,6 +816,7 @@ static inline void scsi_destroy_sdev(struct scsi_device *sdev)
put_device(&sdev->sdev_gendev);
}
+#ifdef CONFIG_SCSI_LOGGING
/**
* scsi_inq_str - print INQUIRY data from min to max index,
* strip trailing whitespace
@@ -824,12 +825,13 @@ static inline void scsi_destroy_sdev(struct scsi_device *sdev)
* @first: Offset of string into inq
* @end: Index after last character in inq
*/
-static unsigned char* scsi_inq_str(unsigned char* buf, unsigned char *inq,
+static unsigned char *scsi_inq_str(unsigned char *buf, unsigned char *inq,
unsigned first, unsigned end)
{
unsigned term = 0, idx;
- for (idx = 0; idx+first < end && idx+first < inq[4]+5; ++idx) {
- if (inq[idx+first] > 0x20) {
+
+ for (idx = 0; idx + first < end && idx + first < inq[4] + 5; idx++) {
+ if (inq[idx+first] > ' ') {
buf[idx] = inq[idx+first];
term = idx+1;
} else {
@@ -839,6 +841,7 @@ static unsigned char* scsi_inq_str(unsigned char* buf, unsigned char *inq,
buf[term] = 0;
return buf;
}
+#endif
/**
* scsi_probe_and_add_lun - probe a LUN, if a LUN is found add it
@@ -923,12 +926,16 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget,
" peripheral qualifier of 3, device not"
" added\n"))
if (lun == 0) {
- unsigned char vend[9], mod[17];
- SCSI_LOG_SCAN_BUS(1, sdev_printk(KERN_INFO, sdev,
+ SCSI_LOG_SCAN_BUS(1, {
+ unsigned char vend[9];
+ unsigned char mod[17];
+
+ sdev_printk(KERN_INFO, sdev,
"scsi scan: consider passing scsi_mod."
"dev_flags=%s:%s:0x240 or 0x800240\n",
scsi_inq_str(vend, result, 8, 16),
- scsi_inq_str(mod, result, 16, 32)));
+ scsi_inq_str(mod, result, 16, 32));
+ });
}
res = SCSI_SCAN_TARGET_PRESENT;
OpenPOWER on IntegriCloud