From 7d42767817fea9cc734ef0a8a8f91c2bc5923b01 Mon Sep 17 00:00:00 2001 From: Dariusz Stojaczyk Date: Wed, 31 May 2017 14:35:01 +0200 Subject: [PATCH] vhost: removed redundant check in get_scsi_lun() Each call to get_scsi_lun is preceeded with the same check. Change-Id: I4597674f0024e923908d85bbfbd5404c500fddb1 Signed-off-by: Dariusz Stojaczyk Reviewed-on: https://review.gerrithub.io/363172 Reviewed-by: Daniel Verkamp Tested-by: SPDK Automated Test System Reviewed-by: Pawel Wodkowski Reviewed-by: Ben Walker --- lib/vhost/vhost_scsi.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/vhost/vhost_scsi.c b/lib/vhost/vhost_scsi.c index 4b74db045..498408f4e 100644 --- a/lib/vhost/vhost_scsi.c +++ b/lib/vhost/vhost_scsi.c @@ -227,11 +227,7 @@ get_scsi_lun(struct spdk_scsi_dev *scsi_dev, const __u8 *lun) uint16_t lun_id = (((uint16_t)lun[2] << 8) | lun[3]) & 0x3FFF; /* For now only one LUN per controller is allowed so no need to search LUN IDs */ - if (likely(scsi_dev != NULL)) { - return spdk_scsi_dev_get_lun(scsi_dev, lun_id); - } - - return NULL; + return spdk_scsi_dev_get_lun(scsi_dev, lun_id); } static void