scsi: BusLogic: remove variable adapter_count

Message ID 20221031160512.872153-1-colin.i.king@gmail.com
State New
Headers
Series scsi: BusLogic: remove variable adapter_count |

Commit Message

Colin Ian King Oct. 31, 2022, 4:05 p.m. UTC
  Variable adapter_count is just being incremented and it's never used
anywhere else. The variable and the increment are redundant so
remove it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/scsi/BusLogic.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
  

Comments

Khalid Aziz Oct. 31, 2022, 4:13 p.m. UTC | #1
On 10/31/22 10:05, Colin Ian King wrote:
> Variable adapter_count is just being incremented and it's never used
> anywhere else. The variable and the increment are redundant so
> remove it.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
>   drivers/scsi/BusLogic.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)

Looks good to me.

Acked-by: Khalid Aziz <khalid@gonehiking.org>


> 
> diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c
> index f2abffce2659..f7b7ffda1161 100644
> --- a/drivers/scsi/BusLogic.c
> +++ b/drivers/scsi/BusLogic.c
> @@ -2198,7 +2198,7 @@ static int blogic_slaveconfig(struct scsi_device *dev)
>   
>   static int __init blogic_init(void)
>   {
> -	int adapter_count = 0, drvr_optindex = 0, probeindex;
> +	int drvr_optindex = 0, probeindex;
>   	struct blogic_adapter *adapter;
>   	int ret = 0;
>   
> @@ -2368,10 +2368,8 @@ static int __init blogic_init(void)
>   					list_del(&myadapter->host_list);
>   					scsi_host_put(host);
>   					ret = -ENODEV;
> -				} else {
> +				} else
>   					scsi_scan_host(host);
> -					adapter_count++;
> -				}
>   			}
>   		} else {
>   			/*
  
Martin K. Petersen Nov. 8, 2022, 3:01 a.m. UTC | #2
Colin,

> Variable adapter_count is just being incremented and it's never used
> anywhere else. The variable and the increment are redundant so
> remove it.

Applied to 6.2/scsi-staging, thanks!
  
Martin K. Petersen Nov. 17, 2022, 6:29 p.m. UTC | #3
On Mon, 31 Oct 2022 16:05:12 +0000, Colin Ian King wrote:

> Variable adapter_count is just being incremented and it's never used
> anywhere else. The variable and the increment are redundant so
> remove it.
> 
> 

Applied to 6.2/scsi-queue, thanks!

[1/1] scsi: BusLogic: remove variable adapter_count
      https://git.kernel.org/mkp/scsi/c/81cb3eb68af5
  

Patch

diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c
index f2abffce2659..f7b7ffda1161 100644
--- a/drivers/scsi/BusLogic.c
+++ b/drivers/scsi/BusLogic.c
@@ -2198,7 +2198,7 @@  static int blogic_slaveconfig(struct scsi_device *dev)
 
 static int __init blogic_init(void)
 {
-	int adapter_count = 0, drvr_optindex = 0, probeindex;
+	int drvr_optindex = 0, probeindex;
 	struct blogic_adapter *adapter;
 	int ret = 0;
 
@@ -2368,10 +2368,8 @@  static int __init blogic_init(void)
 					list_del(&myadapter->host_list);
 					scsi_host_put(host);
 					ret = -ENODEV;
-				} else {
+				} else
 					scsi_scan_host(host);
-					adapter_count++;
-				}
 			}
 		} else {
 			/*