diff mbox series

[v2,3/3] scsi: smartpqi: remove conditional before pqi_remove_device()

Message ID 20200617083514.19174-4-mwilck@suse.com
State New
Headers show
Series scsi: smartpqi: fixes for scsi device removal | expand

Commit Message

Martin Wilck June 17, 2020, 8:35 a.m. UTC
From: Martin Wilck <mwilck@suse.com>

pqi_remove_device() checks if there's anything to remove, for both
logical and SAS devices. So these conditionals are redundant.
They may actually be wrong, because they would skip removing pysical
devices which are not SMP expanders.

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 drivers/scsi/smartpqi/smartpqi_init.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 87089b67ff74..7e4d5c5ea2b0 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -1879,8 +1879,7 @@  static void pqi_update_device_list(struct pqi_ctrl_info *ctrl_info,
 		} else {
 			pqi_dev_info(ctrl_info, "removed", device);
 		}
-		if (pqi_is_device_added(device))
-			pqi_remove_device(ctrl_info, device);
+		pqi_remove_device(ctrl_info, device);
 		list_del(&device->delete_list_entry);
 		pqi_free_device(device);
 	}
@@ -2223,8 +2222,7 @@  static void pqi_remove_all_scsi_devices(struct pqi_ctrl_info *ctrl_info)
 		if (!device)
 			break;
 
-		if (pqi_is_device_added(device))
-			pqi_remove_device(ctrl_info, device);
+		pqi_remove_device(ctrl_info, device);
 		pqi_free_device(device);
 	}
 }