* [PATCH] bus: ti-sysc: convert sysfs sprintf to sysfs_emit
@ 2023-05-04 8:55 Bo Liu
2023-05-31 5:04 ` Tony Lindgren
0 siblings, 1 reply; 3+ messages in thread
From: Bo Liu @ 2023-05-04 8:55 UTC (permalink / raw)
To: tony; +Cc: linux-omap, linux-kernel, Bo Liu
Follow the advice of the Documentation/filesystems/sysfs.rst
and show() should only use sysfs_emit() or sysfs_emit_at()
when formatting the value to be returned to user space.
Signed-off-by: Bo Liu <liubo03@inspur.com>
---
drivers/bus/ti-sysc.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index 6c49de37d5e9..e3d043de894d 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -969,9 +969,9 @@ static int sysc_show_rev(char *bufp, struct sysc *ddata)
int len;
if (ddata->offsets[SYSC_REVISION] < 0)
- return sprintf(bufp, ":NA");
+ return sysfs_emit(bufp, ":NA");
- len = sprintf(bufp, ":%08x", ddata->revision);
+ len = sysfs_emit(bufp, ":%08x", ddata->revision);
return len;
}
@@ -980,9 +980,9 @@ static int sysc_show_reg(struct sysc *ddata,
char *bufp, enum sysc_registers reg)
{
if (ddata->offsets[reg] < 0)
- return sprintf(bufp, ":NA");
+ return sysfs_emit(bufp, ":NA");
- return sprintf(bufp, ":%x", ddata->offsets[reg]);
+ return sysfs_emit(bufp, ":%x", ddata->offsets[reg]);
}
static int sysc_show_name(char *bufp, struct sysc *ddata)
@@ -990,7 +990,7 @@ static int sysc_show_name(char *bufp, struct sysc *ddata)
if (!ddata->name)
return 0;
- return sprintf(bufp, ":%s", ddata->name);
+ return sysfs_emit(bufp, ":%s", ddata->name);
}
/**
--
2.27.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] bus: ti-sysc: convert sysfs sprintf to sysfs_emit
2023-05-04 8:55 [PATCH] bus: ti-sysc: convert sysfs sprintf to sysfs_emit Bo Liu
@ 2023-05-31 5:04 ` Tony Lindgren
2023-05-31 5:12 ` Tony Lindgren
0 siblings, 1 reply; 3+ messages in thread
From: Tony Lindgren @ 2023-05-31 5:04 UTC (permalink / raw)
To: Bo Liu; +Cc: linux-omap, linux-kernel
* Bo Liu <liubo03@inspur.com> [230504 11:55]:
> Follow the advice of the Documentation/filesystems/sysfs.rst
> and show() should only use sysfs_emit() or sysfs_emit_at()
> when formatting the value to be returned to user space.
Thanks applying into omap-for-v6.5/ti-sysc.
Tony
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] bus: ti-sysc: convert sysfs sprintf to sysfs_emit
2023-05-31 5:04 ` Tony Lindgren
@ 2023-05-31 5:12 ` Tony Lindgren
0 siblings, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2023-05-31 5:12 UTC (permalink / raw)
To: Bo Liu; +Cc: linux-omap, linux-kernel
* Tony Lindgren <tony@atomide.com> [230531 05:05]:
> * Bo Liu <liubo03@inspur.com> [230504 11:55]:
> > Follow the advice of the Documentation/filesystems/sysfs.rst
> > and show() should only use sysfs_emit() or sysfs_emit_at()
> > when formatting the value to be returned to user space.
>
> Thanks applying into omap-for-v6.5/ti-sysc.
Oh but these are currently only used with dev_dbg() on init.
There's no specific sysfs support needed so far. So dropping this
patch.
Regards,
Tony
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-05-31 5:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-04 8:55 [PATCH] bus: ti-sysc: convert sysfs sprintf to sysfs_emit Bo Liu
2023-05-31 5:04 ` Tony Lindgren
2023-05-31 5:12 ` Tony Lindgren
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).