diff mbox series

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

Message ID 20200617083514.19174-4-mwilck@suse.com (mailing list archive)
State Changes Requested
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(-)

Comments

Seymour, Shane M June 18, 2020, 4:32 a.m. UTC | #1
One small typo in the commit message pysical  should be physical.

Reviewed-by: Shane Seymour <shane.seymour@hpe.com>

> -----Original Message-----
> From: mwilck@suse.com [mailto:mwilck@suse.com]
> Sent: Wednesday, 17 June 2020 6:35 PM
> To: Don Brace <don.brace@microsemi.com>; Martin K. Petersen
> <martin.petersen@oracle.com>
> Cc: esc.storagedev@microsemi.com; linux-scsi@vger.kernel.org; Seymour,
> Shane M <shane.seymour@hpe.com>; Martin Wilck <mwilck@suse.com>
> Subject: [PATCH v2 3/3] scsi: smartpqi: remove conditional before
> pqi_remove_device()
> 
> 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 --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);
>  	}
>  }
> --
> 2.26.2
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);
 	}
 }