Skip to contentSkip to conversation

scsi-misc-2.5 fix repeat_inquiry bflags setting

PATCH New Patrick Mansfield 1 participant 1 message Apr 23, 2003 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi-misc-2.5 fix repeat_inquiry bflags setting

James -

The new printk for BLIST_INQUIRY_36 is getting a warning, and the repeat_inquiry code is not quite right, since we reset *bflags after getting the first INQUIRY.

Get rid of the warning, change the or-ing of the bflags settings, and get rid of an extraneous BUG_ON.

===== drivers/scsi/scsi_scan.c 1.78 vs edited =====

drivers/scsi/scsi_scan.c +7 -4
@@ -1001,6 +1001,7 @@
 	unsigned char scsi_cmd[MAX_COMMAND_SIZE];
 	int possible_inq_resp_len;
 
+	*bflags = 0;
  repeat_inquiry:
 	SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO "scsi scan: INQUIRY to host %d"
 			" channel %d id %d lun %d\n", sdev->host->host_no,
@@ -1041,8 +1042,7 @@
 	 * bit fields in Scsi_Device, so bflags need not be passed as an
 	 * argument.
 	 */
-	BUG_ON(bflags == NULL);
-	*bflags = scsi_get_device_flags(&inq_result[8], &inq_result[16]);
+	*bflags |= scsi_get_device_flags(&inq_result[8], &inq_result[16]);
 
 	possible_inq_resp_len = (unsigned char) inq_result[4] + 5;
 	if (BLIST_INQUIRY_36 & *bflags)
@@ -1072,8 +1072,11 @@
 			/* if the longer inquiry has failed, flag the device
 			 * as only accepting 36 byte inquiries and retry the
 			 * 36 byte inquiry */
-			printk(KERN_INFO "scsi scan: %d byte inquiry failed with code %d.  Consider BLIST_INQUIRY_36 for this device\n", sreq->sr_result);
-			*bflags |= BLIST_INQUIRY_36;
+			printk(KERN_INFO "scsi scan: %d byte inquiry failed"
+			       " with code %d.  Consider BLIST_INQUIRY_36 for"
+			       " this device\n", possible_inq_resp_len,
+			       sreq->sr_result);
+			*bflags = BLIST_INQUIRY_36;
 			goto repeat_inquiry;
 		}