Skip to content

Commit

Permalink
[SCSI] scsi_debug: remove unnecessary condition test in devInfoReg
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
FUJITA Tomonori authored and James Bottomley committed Apr 7, 2008
1 parent 5cb2fc0 commit a75869d
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions drivers/scsi/scsi_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a75869d

Please sign in to comment.