[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250317171849700zhgNc5lZvWvM3EepJpYWE@zte.com.cn>
Date: Mon, 17 Mar 2025 17:18:49 +0800 (CST)
From: <tang.dongxing@....com.cn>
To: <jirislaby@...nel.org>
Cc: <jgross@...e.com>, <sstabellini@...nel.org>,
<oleksandr_tyshchenko@...m.com>, <jiqian.chen@....com>,
<ray.huang@....com>, <jeff.johnson@....qualcomm.com>,
<minhuadotchen@...il.com>, <xen-devel@...ts.xenproject.org>,
<linux-kernel@...r.kernel.org>, <ye.xingchen@....com.cn>,
<yang.guang5@....com.cn>, <yang.yang29@....com.cn>,
<xu.xin16@....com.cn>
Subject: Re: [PATCH] xen/pciback: use sysfs_emit_at() instead of scnprintf()
>> From: TangDongxing <tang.dongxing@....com.cn>
>>
>> Follow the advice in Documentation/filesystems/sysfs.rst:
>> show() should only use sysfs_emit() or sysfs_emit_at() when formatting
>> the value to be returned to user space.
>>
>> Signed-off-by: TangDongxing <tang.dongxing@....com.cn>
>> ---
>> drivers/xen/xen-pciback/pci_stub.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c
>> index b616b7768c3b..a0782a74ed34 100644
>> --- a/drivers/xen/xen-pciback/pci_stub.c
>> +++ b/drivers/xen/xen-pciback/pci_stub.c
>> @@ -1281,7 +1281,7 @@ static ssize_t slots_show(struct device_driver *drv, char *buf)
>> if (count >= PAGE_SIZE)
>> break;
>>
>> - count += scnprintf(buf + count, PAGE_SIZE - count,
>> + count += sysfs_emit_at(buf, count,
>
>This is wrong too [1].
>
>[1]
>https://lore.kernel.org/all/9c552d9a-2d46-4069-a9c4-35fab857bfc3@kernel.org/
>
>regards,
>--
>js
>suse labs
Dear JiriSlaby,
Thank you for your feedback,I am sorry for my previous submissions.
I will check my work before sending any further updates.
Thank you for your guidance.
Best regards,
Tang Dongxing
<div class="zcontentRow"><p>>> From: TangDongxing <tang.dongxing@....com.cn></p><p>>> </p><p>>> Follow the advice in Documentation/filesystems/sysfs.rst:</p><p>>> show() should only use sysfs_emit() or sysfs_emit_at() when formatting</p><p>>> the value to be returned to user space.</p><p>>> </p><p>>> Signed-off-by: TangDongxing <tang.dongxing@....com.cn></p><p>>> ---</p><p>>> drivers/xen/xen-pciback/pci_stub.c | 2 +-</p><p>>> 1 file changed, 1 insertion(+), 1 deletion(-)</p><p>>> </p><p>>> diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c</p><p>>> index b616b7768c3b..a0782a74ed34 100644</p><p>>> --- a/drivers/xen/xen-pciback/pci_stub.c</p><p>>> +++ b/drivers/xen/xen-pciback/pci_stub.c</p><p>>> @@ -1281,7 +1281,7 @@ static ssize_t slots_show(struct device_driver *drv, char *buf)</p><p>>> if (count >= PAGE_SIZE)</p><p>>> break;</p><p>>> </p><p>>> - count += scnprintf(buf + count, PAGE_SIZE - count,</p><p>>> + count += sysfs_emit_at(buf, count,</p><p>></p><p>>This is wrong too [1].</p><p>></p><p>>[1] </p><p>>https://lore.kernel.org/all/9c552d9a-2d46-4069-a9c4-35fab857bfc3@kernel.org/</p><p>></p><p>>regards,</p><p>>-- </p><p>>js</p><p>>suse labs</p><p><br></p><p>Dear JiriSlaby,</p><p><br></p><p>Thank you for your feedback,I am sorry for my previous submissions.</p><p>I will check my work before sending any further updates.</p><p><br></p><p>Thank you for your guidance.</p><p><br></p><p>Best regards,</p><p>Tang Dongxing</p><p><br></p></div>
Powered by blists - more mailing lists