linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [SCSI] libsas: add missing newline when printing 'enable' by sysfs
@ 2020-07-17  7:36 Xiongfeng Wang
  2020-07-17  7:54 ` John Garry
  0 siblings, 1 reply; 3+ messages in thread
From: Xiongfeng Wang @ 2020-07-17  7:36 UTC (permalink / raw)
  To: jejb, martin.petersen; +Cc: linux-scsi, linux-kernel, guohanjun, wangxiongfeng2

When I cat sysfs file 'enable' below 'sas_phy', it displays as follows.
It's better to add a newline for easy reading.

[root@localhost ~]# cat /sys/devices/pci0000:00/0000:00:0d.0/0000:0f:00.0/host3/phy-3:2/sas_phy/phy-3:2/enable
1[root@localhost ~]#

Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
---
 drivers/scsi/scsi_transport_sas.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c
index 182fd25..e443dee 100644
--- a/drivers/scsi/scsi_transport_sas.c
+++ b/drivers/scsi/scsi_transport_sas.c
@@ -563,7 +563,7 @@ static ssize_t do_sas_phy_enable(struct device *dev,
 {
 	struct sas_phy *phy = transport_class_to_phy(dev);
 
-	return snprintf(buf, 20, "%d", phy->enabled);
+	return snprintf(buf, 20, "%d\n", phy->enabled);
 }
 
 static DEVICE_ATTR(enable, S_IRUGO | S_IWUSR, show_sas_phy_enable,
-- 
1.7.12.4


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

* Re: [PATCH] [SCSI] libsas: add missing newline when printing 'enable' by sysfs
  2020-07-17  7:36 [PATCH] [SCSI] libsas: add missing newline when printing 'enable' by sysfs Xiongfeng Wang
@ 2020-07-17  7:54 ` John Garry
  2020-07-17  8:28   ` Xiongfeng Wang
  0 siblings, 1 reply; 3+ messages in thread
From: John Garry @ 2020-07-17  7:54 UTC (permalink / raw)
  To: Xiongfeng Wang, jejb, martin.petersen; +Cc: linux-scsi, linux-kernel, guohanjun

On 17/07/2020 08:36, Xiongfeng Wang wrote:

Hi,

I think "scsi: scsi_transport_sas: " would be a better subject prefix, 
as this is not libsas code.

> When I cat sysfs file 'enable' below 'sas_phy', it displays as follows.
> It's better to add a newline for easy reading.
> 
> [root@localhost ~]# cat /sys/devices/pci0000:00/0000:00:0d.0/0000:0f:00.0/host3/phy-3:2/sas_phy/phy-3:2/enable
> 1[root@localhost ~]#
> 
> Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>

Apart from above,
Reviewed-by: John Garry <john.garry@huawei.com>

> ---
>   drivers/scsi/scsi_transport_sas.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c
> index 182fd25..e443dee 100644
> --- a/drivers/scsi/scsi_transport_sas.c
> +++ b/drivers/scsi/scsi_transport_sas.c
> @@ -563,7 +563,7 @@ static ssize_t do_sas_phy_enable(struct device *dev,
>   {
>   	struct sas_phy *phy = transport_class_to_phy(dev);
>   
> -	return snprintf(buf, 20, "%d", phy->enabled);
> +	return snprintf(buf, 20, "%d\n", phy->enabled);
>   }
>   
>   static DEVICE_ATTR(enable, S_IRUGO | S_IWUSR, show_sas_phy_enable,
> 


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

* Re: [PATCH] [SCSI] libsas: add missing newline when printing 'enable' by sysfs
  2020-07-17  7:54 ` John Garry
@ 2020-07-17  8:28   ` Xiongfeng Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Xiongfeng Wang @ 2020-07-17  8:28 UTC (permalink / raw)
  To: John Garry, jejb, martin.petersen; +Cc: linux-scsi, linux-kernel, guohanjun

Hi John,

On 2020/7/17 15:54, John Garry wrote:
> On 17/07/2020 08:36, Xiongfeng Wang wrote:
> 
> Hi,
> 
> I think "scsi: scsi_transport_sas: " would be a better subject prefix, as this
> is not libsas code.
> 
>> When I cat sysfs file 'enable' below 'sas_phy', it displays as follows.
>> It's better to add a newline for easy reading.
>>
>> [root@localhost ~]# cat
>> /sys/devices/pci0000:00/0000:00:0d.0/0000:0f:00.0/host3/phy-3:2/sas_phy/phy-3:2/enable
>>
>> 1[root@localhost ~]#
>>
>> Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
> 
> Apart from above,
> Reviewed-by: John Garry <john.garry@huawei.com>

Thanks for your review. I will send another version.

Thanks,
Xiongfeng

> 
>> ---
>>   drivers/scsi/scsi_transport_sas.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/scsi/scsi_transport_sas.c
>> b/drivers/scsi/scsi_transport_sas.c
>> index 182fd25..e443dee 100644
>> --- a/drivers/scsi/scsi_transport_sas.c
>> +++ b/drivers/scsi/scsi_transport_sas.c
>> @@ -563,7 +563,7 @@ static ssize_t do_sas_phy_enable(struct device *dev,
>>   {
>>       struct sas_phy *phy = transport_class_to_phy(dev);
>>   -    return snprintf(buf, 20, "%d", phy->enabled);
>> +    return snprintf(buf, 20, "%d\n", phy->enabled);
>>   }
>>     static DEVICE_ATTR(enable, S_IRUGO | S_IWUSR, show_sas_phy_enable,
>>
> 
> 
> .


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

end of thread, other threads:[~2020-07-17  8:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-17  7:36 [PATCH] [SCSI] libsas: add missing newline when printing 'enable' by sysfs Xiongfeng Wang
2020-07-17  7:54 ` John Garry
2020-07-17  8:28   ` Xiongfeng Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).