diff mbox series

[1/4] scsi: pm8001: Rework shost initial values

Message ID 1654879602-33497-2-git-send-email-john.garry@huawei.com
State New
Headers show
Series pm8001 driver improvements | expand

Commit Message

John Garry June 10, 2022, 4:46 p.m. UTC
Some values in pm8001_prep_sas_ha_init() are set the same as they would be
set in scsi_host_alloc(), or could be in the sht (which would be better),
or later just overwritten, so rework the following:
- cmd_per_lun can be set in the sht
- max_lun and max_channel are as scsi_host_alloc() (so no need to set)
- can_queue is later overwritten (so don't set in
  pm8001_prep_sas_ha_init())

Signed-off-by: John Garry <john.garry@huawei.com>
---
 drivers/scsi/pm8001/pm8001_init.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Jinpu Wang June 13, 2022, 6:39 a.m. UTC | #1
On Fri, Jun 10, 2022 at 6:52 PM John Garry <john.garry@huawei.com> wrote:
>
> Some values in pm8001_prep_sas_ha_init() are set the same as they would be
> set in scsi_host_alloc(), or could be in the sht (which would be better),
> or later just overwritten, so rework the following:
> - cmd_per_lun can be set in the sht
> - max_lun and max_channel are as scsi_host_alloc() (so no need to set)
> - can_queue is later overwritten (so don't set in
>   pm8001_prep_sas_ha_init())
>
> Signed-off-by: John Garry <john.garry@huawei.com>
lgtm!
Acked-by: Jack Wang <jinpu.wang@ionos.com>
> ---
>  drivers/scsi/pm8001/pm8001_init.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
> index 9b04f1a6a67d..4288c6b8f041 100644
> --- a/drivers/scsi/pm8001/pm8001_init.c
> +++ b/drivers/scsi/pm8001/pm8001_init.c
> @@ -109,6 +109,7 @@ static struct scsi_host_template pm8001_sht = {
>  #endif
>         .shost_groups           = pm8001_host_groups,
>         .track_queue_depth      = 1,
> +       .cmd_per_lun            = 32,
>  };
>
>  /*
> @@ -605,12 +606,8 @@ static int pm8001_prep_sas_ha_init(struct Scsi_Host *shost,
>
>         shost->transportt = pm8001_stt;
>         shost->max_id = PM8001_MAX_DEVICES;
> -       shost->max_lun = 8;
> -       shost->max_channel = 0;
>         shost->unique_id = pm8001_id;
>         shost->max_cmd_len = 16;
> -       shost->can_queue = PM8001_CAN_QUEUE;
> -       shost->cmd_per_lun = 32;
>         return 0;
>  exit_free1:
>         kfree(arr_port);
> --
> 2.26.2
>
diff mbox series

Patch

diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
index 9b04f1a6a67d..4288c6b8f041 100644
--- a/drivers/scsi/pm8001/pm8001_init.c
+++ b/drivers/scsi/pm8001/pm8001_init.c
@@ -109,6 +109,7 @@  static struct scsi_host_template pm8001_sht = {
 #endif
 	.shost_groups		= pm8001_host_groups,
 	.track_queue_depth	= 1,
+	.cmd_per_lun		= 32,
 };
 
 /*
@@ -605,12 +606,8 @@  static int pm8001_prep_sas_ha_init(struct Scsi_Host *shost,
 
 	shost->transportt = pm8001_stt;
 	shost->max_id = PM8001_MAX_DEVICES;
-	shost->max_lun = 8;
-	shost->max_channel = 0;
 	shost->unique_id = pm8001_id;
 	shost->max_cmd_len = 16;
-	shost->can_queue = PM8001_CAN_QUEUE;
-	shost->cmd_per_lun = 32;
 	return 0;
 exit_free1:
 	kfree(arr_port);