From: Damien Le Moal <dlemoal@kernel.org>
To: Niklas Cassel <cassel@kernel.org>,
John Garry <john.g.garry@oracle.com>,
Jason Yan <yanaijie@huawei.com>,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org
Subject: Re: [PATCH v2 04/13] ata,scsi: Remove useless wrappers ata_sas_tport_{add,delete}()
Date: Thu, 27 Jun 2024 10:07:32 +0900 [thread overview]
Message-ID: <b4601197-a273-4f65-8e1a-27a5dfa6d688@kernel.org> (raw)
In-Reply-To: <20240626180031.4050226-19-cassel@kernel.org>
On 6/27/24 03:00, Niklas Cassel wrote:
> Remove useless wrappers ata_sas_tport_add() and ata_sas_tport_delete().
I am not a big fan of this patch. I would prefer to keep everything in
libata-transport local to libata and have the exports done for what libsas needs
using the wrappers, even if some of them are very trivial...
That also allows keeping the naming consistent with the ata_sas_ prefix for
everything that libsas uses from libata.
John ? Thoughts ?
>
> Signed-off-by: Niklas Cassel <cassel@kernel.org>
> ---
> drivers/ata/libata-sata.c | 12 ------------
> drivers/ata/libata-transport.c | 2 ++
> drivers/ata/libata-transport.h | 3 ---
> drivers/scsi/libsas/sas_ata.c | 2 +-
> drivers/scsi/libsas/sas_discover.c | 2 +-
> include/linux/libata.h | 4 ++--
> 6 files changed, 6 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/ata/libata-sata.c b/drivers/ata/libata-sata.c
> index 9e047bf912b1..e7991595bfe5 100644
> --- a/drivers/ata/libata-sata.c
> +++ b/drivers/ata/libata-sata.c
> @@ -1241,18 +1241,6 @@ struct ata_port *ata_sas_port_alloc(struct ata_host *host,
> }
> EXPORT_SYMBOL_GPL(ata_sas_port_alloc);
>
> -int ata_sas_tport_add(struct device *parent, struct ata_port *ap)
> -{
> - return ata_tport_add(parent, ap);
> -}
> -EXPORT_SYMBOL_GPL(ata_sas_tport_add);
> -
> -void ata_sas_tport_delete(struct ata_port *ap)
> -{
> - ata_tport_delete(ap);
> -}
> -EXPORT_SYMBOL_GPL(ata_sas_tport_delete);
> -
> /**
> * ata_sas_device_configure - Default device_configure routine for libata
> * devices
> diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c
> index 3e49a877500e..d24f201c0ab2 100644
> --- a/drivers/ata/libata-transport.c
> +++ b/drivers/ata/libata-transport.c
> @@ -265,6 +265,7 @@ void ata_tport_delete(struct ata_port *ap)
> transport_destroy_device(dev);
> put_device(dev);
> }
> +EXPORT_SYMBOL_GPL(ata_tport_delete);
>
> static const struct device_type ata_port_sas_type = {
> .name = ATA_PORT_TYPE_NAME,
> @@ -329,6 +330,7 @@ int ata_tport_add(struct device *parent,
> put_device(dev);
> return error;
> }
> +EXPORT_SYMBOL_GPL(ata_tport_add);
>
> /**
> * ata_port_classify - determine device type based on ATA-spec signature
> diff --git a/drivers/ata/libata-transport.h b/drivers/ata/libata-transport.h
> index 08a57fb9dc61..50cd2cbe8eea 100644
> --- a/drivers/ata/libata-transport.h
> +++ b/drivers/ata/libata-transport.h
> @@ -8,9 +8,6 @@ extern struct scsi_transport_template *ata_scsi_transport_template;
> int ata_tlink_add(struct ata_link *link);
> void ata_tlink_delete(struct ata_link *link);
>
> -int ata_tport_add(struct device *parent, struct ata_port *ap);
> -void ata_tport_delete(struct ata_port *ap);
> -
> struct scsi_transport_template *ata_attach_transport(void);
> void ata_release_transport(struct scsi_transport_template *t);
>
> diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
> index 4c69fc63c119..1c2400c96ebd 100644
> --- a/drivers/scsi/libsas/sas_ata.c
> +++ b/drivers/scsi/libsas/sas_ata.c
> @@ -608,7 +608,7 @@ int sas_ata_init(struct domain_device *found_dev)
> ap->cbl = ATA_CBL_SATA;
> ap->scsi_host = shost;
>
> - rc = ata_sas_tport_add(ata_host->dev, ap);
> + rc = ata_tport_add(ata_host->dev, ap);
> if (rc)
> goto destroy_port;
>
> diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c
> index 8fb7c41c0962..6e01ddec10c9 100644
> --- a/drivers/scsi/libsas/sas_discover.c
> +++ b/drivers/scsi/libsas/sas_discover.c
> @@ -300,7 +300,7 @@ void sas_free_device(struct kref *kref)
> kfree(dev->ex_dev.ex_phy);
>
> if (dev_is_sata(dev) && dev->sata_dev.ap) {
> - ata_sas_tport_delete(dev->sata_dev.ap);
> + ata_tport_delete(dev->sata_dev.ap);
> kfree(dev->sata_dev.ap);
> ata_host_put(dev->sata_dev.ata_host);
> dev->sata_dev.ata_host = NULL;
> diff --git a/include/linux/libata.h b/include/linux/libata.h
> index 13fb41d25da6..581e166615fa 100644
> --- a/include/linux/libata.h
> +++ b/include/linux/libata.h
> @@ -1249,8 +1249,8 @@ extern int ata_slave_link_init(struct ata_port *ap);
> extern struct ata_port *ata_sas_port_alloc(struct ata_host *,
> struct ata_port_info *, struct Scsi_Host *);
> extern void ata_port_probe(struct ata_port *ap);
> -extern int ata_sas_tport_add(struct device *parent, struct ata_port *ap);
> -extern void ata_sas_tport_delete(struct ata_port *ap);
> +extern int ata_tport_add(struct device *parent, struct ata_port *ap);
> +extern void ata_tport_delete(struct ata_port *ap);
> int ata_sas_device_configure(struct scsi_device *sdev, struct queue_limits *lim,
> struct ata_port *ap);
> extern int ata_sas_queuecmd(struct scsi_cmnd *cmd, struct ata_port *ap);
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2024-06-27 1:07 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-26 18:00 [PATCH v2 00/13] ata,libsas: Assign the unique id used for printing earlier Niklas Cassel
2024-06-26 18:00 ` [PATCH v2 01/13] ata: libata-core: Fix null pointer dereference on error Niklas Cassel
2024-06-27 1:00 ` Damien Le Moal
2024-06-27 6:24 ` Hannes Reinecke
2024-06-26 18:00 ` [PATCH v2 02/13] ata: libata-core: Fix double free " Niklas Cassel
2024-06-27 1:02 ` Damien Le Moal
2024-06-27 6:25 ` Hannes Reinecke
2024-06-26 18:00 ` [PATCH v2 03/13] ata: ahci: Clean up sysfs file " Niklas Cassel
2024-06-26 18:34 ` Niklas Cassel
2024-06-27 1:04 ` Damien Le Moal
2024-06-27 6:28 ` Hannes Reinecke
2024-06-26 18:00 ` [PATCH v2 04/13] ata,scsi: Remove useless wrappers ata_sas_tport_{add,delete}() Niklas Cassel
2024-06-27 1:07 ` Damien Le Moal [this message]
2024-06-27 6:29 ` Hannes Reinecke
2024-06-26 18:00 ` [PATCH v2 05/13] ata,scsi: libata-core: Add ata_port_free() Niklas Cassel
2024-06-27 1:15 ` Damien Le Moal
2024-06-29 12:09 ` Niklas Cassel
2024-06-27 6:30 ` Hannes Reinecke
2024-06-26 18:00 ` [PATCH v2 06/13] ata: libata: Remove unused function declaration for ata_scsi_detect() Niklas Cassel
2024-06-27 1:16 ` Damien Le Moal
2024-06-27 6:31 ` Hannes Reinecke
2024-06-26 18:00 ` [PATCH v2 07/13] ata: libata-core: Remove support for decreasing the number of ports Niklas Cassel
2024-06-26 19:30 ` Niklas Cassel
2024-06-27 1:30 ` Damien Le Moal
2024-06-27 6:35 ` Hannes Reinecke
2024-06-29 12:24 ` Niklas Cassel
2024-06-26 18:00 ` [PATCH v2 08/13] ata: libata-sata: Remove superfluous assignment in ata_sas_port_alloc() Niklas Cassel
2024-06-27 1:31 ` Damien Le Moal
2024-06-27 6:37 ` Hannes Reinecke
2024-06-26 18:00 ` [PATCH v2 09/13] ata: libata-core: Remove local_port_no struct member Niklas Cassel
2024-06-27 1:33 ` Damien Le Moal
2024-06-27 6:37 ` Hannes Reinecke
2024-06-26 18:00 ` [PATCH v2 10/13] ata: libata: Assign print_id at port allocation time Niklas Cassel
2024-06-27 6:38 ` Hannes Reinecke
2024-06-26 18:00 ` [PATCH v2 11/13] ata: libata-core: Reuse available ata_port print_ids Niklas Cassel
2024-06-27 1:37 ` Damien Le Moal
2024-07-02 15:43 ` Niklas Cassel
2024-06-27 6:39 ` Hannes Reinecke
2024-06-28 16:31 ` kernel test robot
2024-06-28 18:15 ` Niklas Cassel
2024-06-26 18:00 ` [PATCH v2 12/13] ata,scsi: Remove useless ata_sas_port_alloc() wrapper Niklas Cassel
2024-06-27 1:46 ` Damien Le Moal
2024-06-27 9:48 ` Niklas Cassel
2024-06-28 3:46 ` Damien Le Moal
2024-06-27 6:40 ` Hannes Reinecke
2024-06-26 18:00 ` [PATCH v2 13/13] ata: ahci: Add debug print for external port Niklas Cassel
2024-06-27 6:40 ` Hannes Reinecke
2024-06-27 12:26 ` [PATCH v2 00/13] ata,libsas: Assign the unique id used for printing earlier John Garry
2024-06-27 12:32 ` Niklas Cassel
2024-06-27 12:54 ` John Garry
2024-06-27 15:07 ` Niklas Cassel
2024-07-02 15:43 ` Niklas Cassel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b4601197-a273-4f65-8e1a-27a5dfa6d688@kernel.org \
--to=dlemoal@kernel.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=cassel@kernel.org \
--cc=john.g.garry@oracle.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=yanaijie@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox