Linux-ide Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2] ata: libata: Remove unused parameter in function ata_sas_port_alloc()
@ 2020-05-21  1:17 chenxiang
  2020-05-21  7:23 ` John Garry
  0 siblings, 1 reply; 3+ messages in thread
From: chenxiang @ 2020-05-21  1:17 UTC (permalink / raw)
  To: tj, martin.petersen, brking, john.garry
  Cc: linux-ide, linux-scsi, linuxarm, Xiang Chen

From: Xiang Chen <chenxiang66@hisilicon.com>

Input Parameter shost in function ata_sas_port_alloc() is not used, so
remove it.

Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
---
 drivers/ata/libata-sata.c     | 4 +---
 drivers/scsi/ipr.c            | 2 +-
 drivers/scsi/libsas/sas_ata.c | 2 +-
 include/linux/libata.h        | 2 +-
 4 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/ata/libata-sata.c b/drivers/ata/libata-sata.c
index c16423e..a3c83fe 100644
--- a/drivers/ata/libata-sata.c
+++ b/drivers/ata/libata-sata.c
@@ -1070,7 +1070,6 @@ EXPORT_SYMBOL_GPL(ata_scsi_change_queue_depth);
  *	port_alloc - Allocate port for a SAS attached SATA device
  *	@host: ATA host container for all SAS ports
  *	@port_info: Information from low-level host driver
- *	@shost: SCSI host that the scsi device is attached to
  *
  *	LOCKING:
  *	PCI/etc. bus probe sem.
@@ -1080,8 +1079,7 @@ EXPORT_SYMBOL_GPL(ata_scsi_change_queue_depth);
  */
 
 struct ata_port *ata_sas_port_alloc(struct ata_host *host,
-				    struct ata_port_info *port_info,
-				    struct Scsi_Host *shost)
+				    struct ata_port_info *port_info)
 {
 	struct ata_port *ap;
 
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 7d77997..331c41c 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -4816,7 +4816,7 @@ static int ipr_target_alloc(struct scsi_target *starget)
 		if (!sata_port)
 			return -ENOMEM;
 
-		ap = ata_sas_port_alloc(&ioa_cfg->ata_host, &sata_port_info, shost);
+		ap = ata_sas_port_alloc(&ioa_cfg->ata_host, &sata_port_info);
 		if (ap) {
 			spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
 			sata_port->ioa_cfg = ioa_cfg;
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
index 5d716d3..0cdfae9 100644
--- a/drivers/scsi/libsas/sas_ata.c
+++ b/drivers/scsi/libsas/sas_ata.c
@@ -549,7 +549,7 @@ int sas_ata_init(struct domain_device *found_dev)
 
 	ata_host_init(ata_host, ha->dev, &sas_sata_ops);
 
-	ap = ata_sas_port_alloc(ata_host, &sata_port_info, shost);
+	ap = ata_sas_port_alloc(ata_host, &sata_port_info);
 	if (!ap) {
 		pr_err("ata_sas_port_alloc failed.\n");
 		rc = -ENODEV;
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 8bf5e59..5a6fb80 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -1228,7 +1228,7 @@ extern int sata_link_scr_lpm(struct ata_link *link, enum ata_lpm_policy policy,
 extern int ata_slave_link_init(struct ata_port *ap);
 extern void ata_sas_port_destroy(struct ata_port *);
 extern struct ata_port *ata_sas_port_alloc(struct ata_host *,
-					   struct ata_port_info *, struct Scsi_Host *);
+					   struct ata_port_info *);
 extern void ata_sas_async_probe(struct ata_port *ap);
 extern int ata_sas_sync_probe(struct ata_port *ap);
 extern int ata_sas_port_init(struct ata_port *);
-- 
2.8.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] ata: libata: Remove unused parameter in function ata_sas_port_alloc()
  2020-05-21  1:17 [PATCH v2] ata: libata: Remove unused parameter in function ata_sas_port_alloc() chenxiang
@ 2020-05-21  7:23 ` John Garry
  2020-05-22  3:23   ` chenxiang (M)
  0 siblings, 1 reply; 3+ messages in thread
From: John Garry @ 2020-05-21  7:23 UTC (permalink / raw)
  To: chenxiang, tj, martin.petersen, brking; +Cc: linux-ide, linux-scsi, axboe

On 21/05/2020 02:17, chenxiang wrote:
> From: Xiang Chen <chenxiang66@hisilicon.com>
> 
> Input Parameter shost in function ata_sas_port_alloc() is not used, so
> remove it.
> 
> Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
> ---
>   drivers/ata/libata-sata.c     | 4 +---
>   drivers/scsi/ipr.c            | 2 +-
>   drivers/scsi/libsas/sas_ata.c | 2 +-
>   include/linux/libata.h        | 2 +-
>   4 files changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/ata/libata-sata.c b/drivers/ata/libata-sata.c
> index c16423e..a3c83fe 100644
> --- a/drivers/ata/libata-sata.c
> +++ b/drivers/ata/libata-sata.c
> @@ -1070,7 +1070,6 @@ EXPORT_SYMBOL_GPL(ata_scsi_change_queue_depth);
>    *	port_alloc - Allocate port for a SAS attached SATA device
>    *	@host: ATA host container for all SAS ports
>    *	@port_info: Information from low-level host driver
> - *	@shost: SCSI host that the scsi device is attached to
>    *
>    *	LOCKING:
>    *	PCI/etc. bus probe sem.
> @@ -1080,8 +1079,7 @@ EXPORT_SYMBOL_GPL(ata_scsi_change_queue_depth);
>    */
>   
>   struct ata_port *ata_sas_port_alloc(struct ata_host *host,
> -				    struct ata_port_info *port_info,
> -				    struct Scsi_Host *shost)
> +				    struct ata_port_info *port_info)
>   {
>   	struct ata_port *ap;

A better change could be to add the following, instead of removing the 
argument:

	ap->scsi_host = shost;

And remove the setting from the callsites, upon successful return. But 
then we would need to pass shost=NULL for ipr, as it does not seem to 
set ap->shost - but that may be an oversight.

Thanks,
John

>   
> diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
> index 7d77997..331c41c 100644
> --- a/drivers/scsi/ipr.c
> +++ b/drivers/scsi/ipr.c
> @@ -4816,7 +4816,7 @@ static int ipr_target_alloc(struct scsi_target *starget)
>   		if (!sata_port)
>   			return -ENOMEM;
>   
> -		ap = ata_sas_port_alloc(&ioa_cfg->ata_host, &sata_port_info, shost);
> +		ap = ata_sas_port_alloc(&ioa_cfg->ata_host, &sata_port_info);
>   		if (ap) {
>   			spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
>   			sata_port->ioa_cfg = ioa_cfg;
> diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
> index 5d716d3..0cdfae9 100644
> --- a/drivers/scsi/libsas/sas_ata.c
> +++ b/drivers/scsi/libsas/sas_ata.c
> @@ -549,7 +549,7 @@ int sas_ata_init(struct domain_device *found_dev)
>   
>   	ata_host_init(ata_host, ha->dev, &sas_sata_ops);
>   
> -	ap = ata_sas_port_alloc(ata_host, &sata_port_info, shost);
> +	ap = ata_sas_port_alloc(ata_host, &sata_port_info);
>   	if (!ap) {
>   		pr_err("ata_sas_port_alloc failed.\n");
>   		rc = -ENODEV;
> diff --git a/include/linux/libata.h b/include/linux/libata.h
> index 8bf5e59..5a6fb80 100644
> --- a/include/linux/libata.h
> +++ b/include/linux/libata.h
> @@ -1228,7 +1228,7 @@ extern int sata_link_scr_lpm(struct ata_link *link, enum ata_lpm_policy policy,
>   extern int ata_slave_link_init(struct ata_port *ap);
>   extern void ata_sas_port_destroy(struct ata_port *);
>   extern struct ata_port *ata_sas_port_alloc(struct ata_host *,
> -					   struct ata_port_info *, struct Scsi_Host *);
> +					   struct ata_port_info *);
>   extern void ata_sas_async_probe(struct ata_port *ap);
>   extern int ata_sas_sync_probe(struct ata_port *ap);
>   extern int ata_sas_port_init(struct ata_port *);
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] ata: libata: Remove unused parameter in function ata_sas_port_alloc()
  2020-05-21  7:23 ` John Garry
@ 2020-05-22  3:23   ` chenxiang (M)
  0 siblings, 0 replies; 3+ messages in thread
From: chenxiang (M) @ 2020-05-22  3:23 UTC (permalink / raw)
  To: John Garry, tj, martin.petersen, brking; +Cc: linux-ide, linux-scsi, axboe



在 2020/5/21 15:23, John Garry 写道:
> On 21/05/2020 02:17, chenxiang wrote:
>> From: Xiang Chen <chenxiang66@hisilicon.com>
>>
>> Input Parameter shost in function ata_sas_port_alloc() is not used, so
>> remove it.
>>
>> Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
>> ---
>>   drivers/ata/libata-sata.c     | 4 +---
>>   drivers/scsi/ipr.c            | 2 +-
>>   drivers/scsi/libsas/sas_ata.c | 2 +-
>>   include/linux/libata.h        | 2 +-
>>   4 files changed, 4 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/ata/libata-sata.c b/drivers/ata/libata-sata.c
>> index c16423e..a3c83fe 100644
>> --- a/drivers/ata/libata-sata.c
>> +++ b/drivers/ata/libata-sata.c
>> @@ -1070,7 +1070,6 @@ EXPORT_SYMBOL_GPL(ata_scsi_change_queue_depth);
>>    *    port_alloc - Allocate port for a SAS attached SATA device
>>    *    @host: ATA host container for all SAS ports
>>    *    @port_info: Information from low-level host driver
>> - *    @shost: SCSI host that the scsi device is attached to
>>    *
>>    *    LOCKING:
>>    *    PCI/etc. bus probe sem.
>> @@ -1080,8 +1079,7 @@ EXPORT_SYMBOL_GPL(ata_scsi_change_queue_depth);
>>    */
>>     struct ata_port *ata_sas_port_alloc(struct ata_host *host,
>> -                    struct ata_port_info *port_info,
>> -                    struct Scsi_Host *shost)
>> +                    struct ata_port_info *port_info)
>>   {
>>       struct ata_port *ap;
>
> A better change could be to add the following, instead of removing the 
> argument:
>
>     ap->scsi_host = shost;
>
> And remove the setting from the callsites, upon successful return. But 
> then we would need to pass shost=NULL for ipr, as it does not seem to 
> set ap->shost - but that may be an oversight.

OK, i will update it in next version.

>
> Thanks,
> John
>
>>   diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
>> index 7d77997..331c41c 100644
>> --- a/drivers/scsi/ipr.c
>> +++ b/drivers/scsi/ipr.c
>> @@ -4816,7 +4816,7 @@ static int ipr_target_alloc(struct scsi_target 
>> *starget)
>>           if (!sata_port)
>>               return -ENOMEM;
>>   -        ap = ata_sas_port_alloc(&ioa_cfg->ata_host, 
>> &sata_port_info, shost);
>> +        ap = ata_sas_port_alloc(&ioa_cfg->ata_host, &sata_port_info);
>>           if (ap) {
>>               spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
>>               sata_port->ioa_cfg = ioa_cfg;
>> diff --git a/drivers/scsi/libsas/sas_ata.c 
>> b/drivers/scsi/libsas/sas_ata.c
>> index 5d716d3..0cdfae9 100644
>> --- a/drivers/scsi/libsas/sas_ata.c
>> +++ b/drivers/scsi/libsas/sas_ata.c
>> @@ -549,7 +549,7 @@ int sas_ata_init(struct domain_device *found_dev)
>>         ata_host_init(ata_host, ha->dev, &sas_sata_ops);
>>   -    ap = ata_sas_port_alloc(ata_host, &sata_port_info, shost);
>> +    ap = ata_sas_port_alloc(ata_host, &sata_port_info);
>>       if (!ap) {
>>           pr_err("ata_sas_port_alloc failed.\n");
>>           rc = -ENODEV;
>> diff --git a/include/linux/libata.h b/include/linux/libata.h
>> index 8bf5e59..5a6fb80 100644
>> --- a/include/linux/libata.h
>> +++ b/include/linux/libata.h
>> @@ -1228,7 +1228,7 @@ extern int sata_link_scr_lpm(struct ata_link 
>> *link, enum ata_lpm_policy policy,
>>   extern int ata_slave_link_init(struct ata_port *ap);
>>   extern void ata_sas_port_destroy(struct ata_port *);
>>   extern struct ata_port *ata_sas_port_alloc(struct ata_host *,
>> -                       struct ata_port_info *, struct Scsi_Host *);
>> +                       struct ata_port_info *);
>>   extern void ata_sas_async_probe(struct ata_port *ap);
>>   extern int ata_sas_sync_probe(struct ata_port *ap);
>>   extern int ata_sas_port_init(struct ata_port *);
>>
>
>
> .
>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-21  1:17 [PATCH v2] ata: libata: Remove unused parameter in function ata_sas_port_alloc() chenxiang
2020-05-21  7:23 ` John Garry
2020-05-22  3:23   ` chenxiang (M)

Linux-ide Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-ide/0 linux-ide/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-ide linux-ide/ https://lore.kernel.org/linux-ide \
		linux-ide@vger.kernel.org
	public-inbox-index linux-ide

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-ide


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git