aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakpm@osdl.org <akpm@osdl.org>2006-04-15 03:30:24 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-04-15 10:04:40 -0400
commitc5f2e6404c65e8380c9ba80a7d58a27d2642743b (patch)
treea8af59f4cd7154032ac35486586babe73467b3c9
parentcdb8c2a6d848deb9eeefffff42974478fbb51b8c (diff)
[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>
-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 e1722ba94586..a3e2af6a846c 100644
--- a/drivers/scsi/scsi_logging.h
+++ b/drivers/scsi/scsi_logging.h
@@ -45,10 +45,12 @@ extern unsigned int scsi_logging_level;
45 ((scsi_logging_level >> (SHIFT)) & ((1 << (BITS)) - 1)) 45 ((scsi_logging_level >> (SHIFT)) & ((1 << (BITS)) - 1))
46 46
47#define SCSI_CHECK_LOGGING(SHIFT, BITS, LEVEL, CMD) \ 47#define SCSI_CHECK_LOGGING(SHIFT, BITS, LEVEL, CMD) \
48{ \ 48do { \
49 if (unlikely((SCSI_LOG_LEVEL(SHIFT, BITS)) > (LEVEL))) \ 49 if (unlikely((SCSI_LOG_LEVEL(SHIFT, BITS)) > (LEVEL))) \
50 (CMD); \ 50 do { \
51} 51 CMD; \
52 } while (0); \
53} while (0)
52#else 54#else
53#define SCSI_CHECK_LOGGING(SHIFT, BITS, LEVEL, CMD) 55#define SCSI_CHECK_LOGGING(SHIFT, BITS, LEVEL, CMD)
54#endif /* CONFIG_SCSI_LOGGING */ 56#endif /* CONFIG_SCSI_LOGGING */
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 5c7e51f9efed..f85d9100f554 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)
816 put_device(&sdev->sdev_gendev); 816 put_device(&sdev->sdev_gendev);
817} 817}
818 818
819#ifdef CONFIG_SCSI_LOGGING
819/** 820/**
820 * scsi_inq_str - print INQUIRY data from min to max index, 821 * scsi_inq_str - print INQUIRY data from min to max index,
821 * strip trailing whitespace 822 * strip trailing whitespace
@@ -824,12 +825,13 @@ static inline void scsi_destroy_sdev(struct scsi_device *sdev)
824 * @first: Offset of string into inq 825 * @first: Offset of string into inq
825 * @end: Index after last character in inq 826 * @end: Index after last character in inq
826 */ 827 */
827static unsigned char* scsi_inq_str(unsigned char* buf, unsigned char *inq, 828static unsigned char *scsi_inq_str(unsigned char *buf, unsigned char *inq,
828 unsigned first, unsigned end) 829 unsigned first, unsigned end)
829{ 830{
830 unsigned term = 0, idx; 831 unsigned term = 0, idx;
831 for (idx = 0; idx+first < end && idx+first < inq[4]+5; ++idx) { 832
832 if (inq[idx+first] > 0x20) { 833 for (idx = 0; idx + first < end && idx + first < inq[4] + 5; idx++) {
834 if (inq[idx+first] > ' ') {
833 buf[idx] = inq[idx+first]; 835 buf[idx] = inq[idx+first];
834 term = idx+1; 836 term = idx+1;
835 } else { 837 } else {
@@ -839,6 +841,7 @@ static unsigned char* scsi_inq_str(unsigned char* buf, unsigned char *inq,
839 buf[term] = 0; 841 buf[term] = 0;
840 return buf; 842 return buf;
841} 843}
844#endif
842 845
843/** 846/**
844 * scsi_probe_and_add_lun - probe a LUN, if a LUN is found add it 847 * 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,
923 " peripheral qualifier of 3, device not" 926 " peripheral qualifier of 3, device not"
924 " added\n")) 927 " added\n"))
925 if (lun == 0) { 928 if (lun == 0) {
926 unsigned char vend[9], mod[17]; 929 SCSI_LOG_SCAN_BUS(1, {
927 SCSI_LOG_SCAN_BUS(1, sdev_printk(KERN_INFO, sdev, 930 unsigned char vend[9];
931 unsigned char mod[17];
932
933 sdev_printk(KERN_INFO, sdev,
928 "scsi scan: consider passing scsi_mod." 934 "scsi scan: consider passing scsi_mod."
929 "dev_flags=%s:%s:0x240 or 0x800240\n", 935 "dev_flags=%s:%s:0x240 or 0x800240\n",
930 scsi_inq_str(vend, result, 8, 16), 936 scsi_inq_str(vend, result, 8, 16),
931 scsi_inq_str(mod, result, 16, 32))); 937 scsi_inq_str(mod, result, 16, 32));
938 });
932 } 939 }
933 940
934 res = SCSI_SCAN_TARGET_PRESENT; 941 res = SCSI_SCAN_TARGET_PRESENT;