Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Jason Yan <yanaijie@huawei.com>
To: John Garry <john.g.garry@oracle.com>,
	<martin.petersen@oracle.com>, <jejb@linux.ibm.com>
Cc: <linux-scsi@vger.kernel.org>, <hare@suse.com>, <hch@lst.de>,
	<bvanassche@acm.org>, <jinpu.wang@cloud.ionos.com>,
	<damien.lemoal@opensource.wdc.com>
Subject: Re: [PATCH v2 4/5] scsi: libsas: factor out sas_ata_add_dev()
Date: Wed, 14 Dec 2022 10:46:54 +0800	[thread overview]
Message-ID: <6b022246-f3de-bf99-cb07-c408a356c2d6@huawei.com> (raw)
In-Reply-To: <76747055-4b60-a5d0-2b40-8140efcb29ae@oracle.com>

On 2022/12/14 0:22, John Garry wrote:
> On 13/12/2022 15:09, Jason Yan wrote:
>> Factor out sas_ata_add_dev() and put it in sas_ata.c since it is a sata
>> related interface. Also follow the standard coding style to define an
>> inline empty function when CONFIG_SCSI_SAS_ATA is not enabled.
>>
>> Cc: John Garry <john.g.garry@oracle.com>
>> Signed-off-by: Jason Yan <yanaijie@huawei.com>
> 
> Apart from comment, below:
> 
> Reviewed-by: John Garry <john.g.garry@oracle.com>
> 
>> ---
>>   drivers/scsi/libsas/sas_ata.c      | 62 ++++++++++++++++++++++++++++++
>>   drivers/scsi/libsas/sas_expander.c | 54 +-------------------------
>>   include/scsi/sas_ata.h             |  9 +++++
>>   3 files changed, 73 insertions(+), 52 deletions(-)
>>
>> diff --git a/drivers/scsi/libsas/sas_ata.c 
>> b/drivers/scsi/libsas/sas_ata.c
> 
>> @@ -109,6 +111,13 @@ static inline int sas_discover_sata(struct 
>> domain_device *dev)
>>       pr_notice("ATA device seen but CONFIG_SCSI_SAS_ATA=N so cannot 
>> attach\n");
>>       return -ENXIO;
>>   }
>> +static inline int sas_ata_add_dev(struct domain_device *parent, 
>> struct ex_phy *phy,
>> +                  struct domain_device *child, int phy_id)
>> +{
>> +    pr_notice("ATA device seen but CONFIG_SCSI_SAS_ATA=N so cannot 
>> add device, target proto 0x%x at %016llx:0x%x\n",
>> +          phy->attached_tproto, SAS_ADDR(parent->sas_addr), phy_id);
> 
> Do you really think that we need to add all this info, like 
> parent->sas_addr?
> 

I did not want to change the functionality at the first time so I kept 
these info printing.

> Indeed, I think that we could make all these prints for 
> CONFIG_SCSI_SAS_ATA=N into a single global pr_notice_once(). That's just 
> my thoughts.
> 

Yeah, makes sense. Let me have a try.

Thanks

>> +    return -ENODEV;
>> +}
>>   #endif
>>   #endif /* _SAS_ATA_H_ */
> 
> .

  reply	other threads:[~2022-12-14  2:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-13 15:09 [PATCH v2 0/5] scsi: libsas: Some coding style fixes and cleanups Jason Yan
2022-12-13 15:09 ` [PATCH v2 1/5] scsi: libsas: move sas_get_ata_command_set() up to save the declaration Jason Yan
2022-12-13 16:00   ` John Garry
2022-12-13 15:09 ` [PATCH v2 2/5] scsi: libsas: change the coding style of sas_discover_sata() Jason Yan
2022-12-13 16:08   ` John Garry
2022-12-13 15:09 ` [PATCH v2 3/5] scsi: libsas: remove useless dev_list delete in sas_ex_discover_end_dev() Jason Yan
2022-12-13 16:13   ` John Garry
2022-12-13 15:09 ` [PATCH v2 4/5] scsi: libsas: factor out sas_ata_add_dev() Jason Yan
2022-12-13 16:22   ` John Garry
2022-12-14  2:46     ` Jason Yan [this message]
2022-12-13 15:09 ` [PATCH v2 5/5] scsi: libsas: factor out sas_ex_add_dev() Jason Yan
2022-12-13 16:24   ` John Garry
2022-12-13 16:12 ` [PATCH v2 0/5] scsi: libsas: Some coding style fixes and cleanups John Garry
2022-12-14  2:54   ` Jason Yan

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=6b022246-f3de-bf99-cb07-c408a356c2d6@huawei.com \
    --to=yanaijie@huawei.com \
    --cc=bvanassche@acm.org \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=hare@suse.com \
    --cc=hch@lst.de \
    --cc=jejb@linux.ibm.com \
    --cc=jinpu.wang@cloud.ionos.com \
    --cc=john.g.garry@oracle.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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