From: John Garry <john.g.garry@oracle.com>
To: Niklas Cassel <Niklas.Cassel@wdc.com>
Cc: Niklas Cassel <nks@flawful.org>,
Damien Le Moal <dlemoal@kernel.org>,
Jason Yan <yanaijie@huawei.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Hannes Reinecke <hare@suse.com>,
"linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
Hannes Reinecke <hare@suse.de>
Subject: Re: [PATCH v2 3/8] ata,scsi: remove ata_sas_port_destroy()
Date: Tue, 25 Jul 2023 08:34:27 +0100 [thread overview]
Message-ID: <7224475b-d751-b849-0135-92ae4979336d@oracle.com> (raw)
In-Reply-To: <ZLqJF03vWDg9KQ+e@x1-carbon>
On 21/07/2023 14:33, Niklas Cassel wrote:
> On Thu, Jul 20, 2023 at 09:57:29AM +0100, John Garry wrote:
>> On 20/07/2023 01:42, Niklas Cassel wrote:
>>> From: Hannes Reinecke <hare@suse.de>
>>>
>>> Is now a wrapper around kfree(), so call it directly.
>>>
>>> Signed-off-by: Hannes Reinecke <hare@suse.de>
>>> Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
>>> ---
>>> drivers/ata/libata-sata.c | 18 ------------------
>>> drivers/scsi/libsas/sas_ata.c | 2 +-
>>> drivers/scsi/libsas/sas_discover.c | 2 +-
>>> include/linux/libata.h | 1 -
>>> 4 files changed, 2 insertions(+), 21 deletions(-)
>>>
>>> diff --git a/drivers/ata/libata-sata.c b/drivers/ata/libata-sata.c
>>> index d3b595294eee..b5de0f40ea25 100644
>>> --- a/drivers/ata/libata-sata.c
>>> +++ b/drivers/ata/libata-sata.c
>>> @@ -1177,10 +1177,6 @@ EXPORT_SYMBOL_GPL(ata_sas_sync_probe);
>>> int ata_sas_port_init(struct ata_port *ap)
>>
Hi Niklas,
>> This is a bit of a daft function now, considering it only does
>> atomic_inc_return(&ata_print_id). Do we really need to export a symbol for
>> that?
>
> $ git grep ata_print_id
> drivers/ata/libata-core.c:atomic_t ata_print_id = ATOMIC_INIT(0);
> drivers/ata/libata-core.c: host->ports[i]->print_id = atomic_inc_return(&ata_print_id);
> drivers/ata/libata-sata.c: ap->print_id = atomic_inc_return(&ata_print_id);
> drivers/ata/libata.h:extern atomic_t ata_print_id;
>
> It seems to be defined and used only in libata, while I agree that the function
> is a bit silly, with my limited knowledge of how the linker works, moving it to
> libsas seems a bit dangerous...
>
> You can build libata as a module and libsas as built-in, and vice versa...
>
> Also, since there are no direct users in libsas, I'd rather keep it in libata.
I wasn't really suggesting to move it to libsas - indeed, it is libata
functionality.
Could you just put the ap->print_id = atomic_inc_return(&ata_print_id)
call in ata_sas_port_alloc() (and remove ata_sas_port_init())?
ata_sas_port_alloc() is only called from libsas, and ata_sas_port_init()
is called straight after ata_sas_port_alloc() there. And
ata_sas_port_alloc() is already doing ap init also (so setting
ap->print_id would not be out of place there).
Thanks,
John
next prev parent reply other threads:[~2023-07-25 7:39 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-20 0:42 [PATCH v2 0/8] libata: remove references to 'old' error handler Niklas Cassel
2023-07-20 0:42 ` [PATCH v2 1/8] ata: remove reference to non-existing error_handler() Niklas Cassel
2023-07-20 8:47 ` John Garry
2023-07-21 13:19 ` Niklas Cassel
2023-07-20 0:42 ` [PATCH v2 2/8] ata,scsi: remove ata_sas_port_{start,stop} callbacks Niklas Cassel
2023-07-20 1:45 ` Jason Yan
2023-07-20 0:42 ` [PATCH v2 3/8] ata,scsi: remove ata_sas_port_destroy() Niklas Cassel
2023-07-20 8:57 ` John Garry
2023-07-21 13:33 ` Niklas Cassel
2023-07-25 7:34 ` John Garry [this message]
2023-07-20 0:42 ` [PATCH v2 4/8] ata: remove ata_sas_sync_probe() Niklas Cassel
2023-07-20 1:53 ` Jason Yan
2023-07-20 0:42 ` [PATCH v2 5/8] ata: inline ata_port_probe() Niklas Cassel
2023-07-20 1:53 ` Jason Yan
2023-07-20 0:42 ` [PATCH v2 6/8] ata,scsi: cleanup ata_port_probe() Niklas Cassel
2023-07-20 1:55 ` Jason Yan
2023-07-20 8:27 ` John Garry
2023-07-21 13:43 ` Niklas Cassel
2023-07-20 0:42 ` [PATCH v2 7/8] ata: sata_sx4: drop already completed TODO Niklas Cassel
2023-07-20 1:56 ` Jason Yan
2023-07-20 5:49 ` Hannes Reinecke
2023-07-20 0:42 ` [PATCH v2 8/8] ata: remove ata_bus_probe() Niklas Cassel
2023-07-20 1:56 ` Jason Yan
2023-07-20 5:49 ` Hannes Reinecke
2023-07-20 8:12 ` John Garry
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=7224475b-d751-b849-0135-92ae4979336d@oracle.com \
--to=john.g.garry@oracle.com \
--cc=Niklas.Cassel@wdc.com \
--cc=dlemoal@kernel.org \
--cc=hare@suse.com \
--cc=hare@suse.de \
--cc=jejb@linux.ibm.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=nks@flawful.org \
--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