* [PATCH] soc: hisilicon: kunpeng_hccs: Fix incorrect string assembly
@ 2025-03-14 8:28 Huisong Li
2025-03-14 10:01 ` Jonathan Cameron
0 siblings, 1 reply; 3+ messages in thread
From: Huisong Li @ 2025-03-14 8:28 UTC (permalink / raw)
To: xuwei5
Cc: linux-kernel, soc, linux-arm-kernel, Jonathan.Cameron,
liuyonglong, lihuisong
String assembly should use sysfs_emit_at() instead of sysfs_emit().
Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
drivers/soc/hisilicon/kunpeng_hccs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/soc/hisilicon/kunpeng_hccs.c b/drivers/soc/hisilicon/kunpeng_hccs.c
index 8aa8dec14911..444a8f59b7da 100644
--- a/drivers/soc/hisilicon/kunpeng_hccs.c
+++ b/drivers/soc/hisilicon/kunpeng_hccs.c
@@ -1539,8 +1539,8 @@ static ssize_t used_types_show(struct kobject *kobj,
u16 i;
for (i = 0; i < hdev->used_type_num - 1; i++)
- len += sysfs_emit(&buf[len], "%s ", hdev->type_name_maps[i].name);
- len += sysfs_emit(&buf[len], "%s\n", hdev->type_name_maps[i].name);
+ len += sysfs_emit_at(buf, len, "%s ", hdev->type_name_maps[i].name);
+ len += sysfs_emit_at(buf, len, "%s\n", hdev->type_name_maps[i].name);
return len;
}
--
2.33.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] soc: hisilicon: kunpeng_hccs: Fix incorrect string assembly
2025-03-14 8:28 [PATCH] soc: hisilicon: kunpeng_hccs: Fix incorrect string assembly Huisong Li
@ 2025-03-14 10:01 ` Jonathan Cameron
2025-03-14 10:08 ` lihuisong (C)
0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Cameron @ 2025-03-14 10:01 UTC (permalink / raw)
To: Huisong Li; +Cc: xuwei5, linux-kernel, soc, linux-arm-kernel, liuyonglong
On Fri, 14 Mar 2025 16:28:56 +0800
Huisong Li <lihuisong@huawei.com> wrote:
> String assembly should use sysfs_emit_at() instead of sysfs_emit().
>
> Signed-off-by: Huisong Li <lihuisong@huawei.com>
Fixes tag?
Otherwise looks good to me.
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
> drivers/soc/hisilicon/kunpeng_hccs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/soc/hisilicon/kunpeng_hccs.c b/drivers/soc/hisilicon/kunpeng_hccs.c
> index 8aa8dec14911..444a8f59b7da 100644
> --- a/drivers/soc/hisilicon/kunpeng_hccs.c
> +++ b/drivers/soc/hisilicon/kunpeng_hccs.c
> @@ -1539,8 +1539,8 @@ static ssize_t used_types_show(struct kobject *kobj,
> u16 i;
>
> for (i = 0; i < hdev->used_type_num - 1; i++)
> - len += sysfs_emit(&buf[len], "%s ", hdev->type_name_maps[i].name);
> - len += sysfs_emit(&buf[len], "%s\n", hdev->type_name_maps[i].name);
> + len += sysfs_emit_at(buf, len, "%s ", hdev->type_name_maps[i].name);
> + len += sysfs_emit_at(buf, len, "%s\n", hdev->type_name_maps[i].name);
>
> return len;
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] soc: hisilicon: kunpeng_hccs: Fix incorrect string assembly
2025-03-14 10:01 ` Jonathan Cameron
@ 2025-03-14 10:08 ` lihuisong (C)
0 siblings, 0 replies; 3+ messages in thread
From: lihuisong (C) @ 2025-03-14 10:08 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: xuwei5, linux-kernel, soc, linux-arm-kernel, liuyonglong
在 2025/3/14 18:01, Jonathan Cameron 写道:
> On Fri, 14 Mar 2025 16:28:56 +0800
> Huisong Li <lihuisong@huawei.com> wrote:
>
>> String assembly should use sysfs_emit_at() instead of sysfs_emit().
>>
>> Signed-off-by: Huisong Li <lihuisong@huawei.com>
> Fixes tag?
ok, will add it.
>
> Otherwise looks good to me.
>
> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
>> ---
>> drivers/soc/hisilicon/kunpeng_hccs.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/soc/hisilicon/kunpeng_hccs.c b/drivers/soc/hisilicon/kunpeng_hccs.c
>> index 8aa8dec14911..444a8f59b7da 100644
>> --- a/drivers/soc/hisilicon/kunpeng_hccs.c
>> +++ b/drivers/soc/hisilicon/kunpeng_hccs.c
>> @@ -1539,8 +1539,8 @@ static ssize_t used_types_show(struct kobject *kobj,
>> u16 i;
>>
>> for (i = 0; i < hdev->used_type_num - 1; i++)
>> - len += sysfs_emit(&buf[len], "%s ", hdev->type_name_maps[i].name);
>> - len += sysfs_emit(&buf[len], "%s\n", hdev->type_name_maps[i].name);
>> + len += sysfs_emit_at(buf, len, "%s ", hdev->type_name_maps[i].name);
>> + len += sysfs_emit_at(buf, len, "%s\n", hdev->type_name_maps[i].name);
>>
>> return len;
>> }
> .
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-03-14 10:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-14 8:28 [PATCH] soc: hisilicon: kunpeng_hccs: Fix incorrect string assembly Huisong Li
2025-03-14 10:01 ` Jonathan Cameron
2025-03-14 10:08 ` lihuisong (C)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox