[SCSI] scsi_debug: remove unnecessary condition test in devInfoReg
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Thu, 20 Mar 2008 02:09:17 +0000 (11:09 +0900)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Mon, 7 Apr 2008 17:18:58 +0000 (12:18 -0500)
open_devip is always non NULL.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Douglas Gilbert <dougg@torque.net>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/scsi_debug.c

index 161af1ded8880400855ee341ec4fbc225c95b2df..1a9106353f72f87da29c6a0453f696cb07c749d9 100644 (file)
@@ -2059,25 +2059,24 @@ static struct sdebug_dev_info * devInfoReg(struct scsi_device * sdev)
                        return NULL;
                }
        }
-        if (open_devip) {
-               open_devip->channel = sdev->channel;
-               open_devip->target = sdev->id;
-               open_devip->lun = sdev->lun;
-               open_devip->sdbg_host = sdbg_host;
-               open_devip->reset = 1;
-               open_devip->used = 1;
-               memset(open_devip->sense_buff, 0, SDEBUG_SENSE_LEN);
-               if (scsi_debug_dsense)
-                       open_devip->sense_buff[0] = 0x72;
-               else {
-                       open_devip->sense_buff[0] = 0x70;
-                       open_devip->sense_buff[7] = 0xa;
-               }
-               if (sdev->lun == SAM2_WLUN_REPORT_LUNS)
-                       open_devip->wlun = SAM2_WLUN_REPORT_LUNS & 0xff;
-               return open_devip;
-        }
-        return NULL;
+
+       open_devip->channel = sdev->channel;
+       open_devip->target = sdev->id;
+       open_devip->lun = sdev->lun;
+       open_devip->sdbg_host = sdbg_host;
+       open_devip->reset = 1;
+       open_devip->used = 1;
+       memset(open_devip->sense_buff, 0, SDEBUG_SENSE_LEN);
+       if (scsi_debug_dsense)
+               open_devip->sense_buff[0] = 0x72;
+       else {
+               open_devip->sense_buff[0] = 0x70;
+               open_devip->sense_buff[7] = 0xa;
+       }
+       if (sdev->lun == SAM2_WLUN_REPORT_LUNS)
+               open_devip->wlun = SAM2_WLUN_REPORT_LUNS & 0xff;
+
+       return open_devip;
 }
 
 static void mk_sense_buffer(struct sdebug_dev_info * devip, int key,