* [PATCH] i3c: prefix hexadecimal entries in sysfs
@ 2025-07-07 11:54 Wolfram Sang
2025-07-07 16:19 ` Frank Li
2025-07-07 21:32 ` Alexandre Belloni
0 siblings, 2 replies; 3+ messages in thread
From: Wolfram Sang @ 2025-07-07 11:54 UTC (permalink / raw)
To: linux-renesas-soc; +Cc: Wolfram Sang, Alexandre Belloni, Frank Li, linux-i3c
Hexadecimal values in sysfs should be prefixed with '0x' like e.g. PCI
and SCSI already do it. Also ensure the two digit length since BCR and
DCR are a byte in size.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/i3c/master.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index ea6b99c05f44..ffb734d378e2 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -141,7 +141,7 @@ static ssize_t bcr_show(struct device *dev,
i3c_bus_normaluse_lock(bus);
desc = dev_to_i3cdesc(dev);
- ret = sprintf(buf, "%x\n", desc->info.bcr);
+ ret = sprintf(buf, "0x%02x\n", desc->info.bcr);
i3c_bus_normaluse_unlock(bus);
return ret;
@@ -158,7 +158,7 @@ static ssize_t dcr_show(struct device *dev,
i3c_bus_normaluse_lock(bus);
desc = dev_to_i3cdesc(dev);
- ret = sprintf(buf, "%x\n", desc->info.dcr);
+ ret = sprintf(buf, "0x%02x\n", desc->info.dcr);
i3c_bus_normaluse_unlock(bus);
return ret;
--
2.47.2
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] i3c: prefix hexadecimal entries in sysfs
2025-07-07 11:54 [PATCH] i3c: prefix hexadecimal entries in sysfs Wolfram Sang
@ 2025-07-07 16:19 ` Frank Li
2025-07-07 21:32 ` Alexandre Belloni
1 sibling, 0 replies; 3+ messages in thread
From: Frank Li @ 2025-07-07 16:19 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-renesas-soc, Alexandre Belloni, linux-i3c
On Mon, Jul 07, 2025 at 01:54:08PM +0200, Wolfram Sang wrote:
> Hexadecimal values in sysfs should be prefixed with '0x' like e.g. PCI
> and SCSI already do it. Also ensure the two digit length since BCR and
> DCR are a byte in size.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> ---
> drivers/i3c/master.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
> index ea6b99c05f44..ffb734d378e2 100644
> --- a/drivers/i3c/master.c
> +++ b/drivers/i3c/master.c
> @@ -141,7 +141,7 @@ static ssize_t bcr_show(struct device *dev,
>
> i3c_bus_normaluse_lock(bus);
> desc = dev_to_i3cdesc(dev);
> - ret = sprintf(buf, "%x\n", desc->info.bcr);
> + ret = sprintf(buf, "0x%02x\n", desc->info.bcr);
> i3c_bus_normaluse_unlock(bus);
>
> return ret;
> @@ -158,7 +158,7 @@ static ssize_t dcr_show(struct device *dev,
>
> i3c_bus_normaluse_lock(bus);
> desc = dev_to_i3cdesc(dev);
> - ret = sprintf(buf, "%x\n", desc->info.dcr);
> + ret = sprintf(buf, "0x%02x\n", desc->info.dcr);
> i3c_bus_normaluse_unlock(bus);
>
> return ret;
> --
> 2.47.2
>
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] i3c: prefix hexadecimal entries in sysfs
2025-07-07 11:54 [PATCH] i3c: prefix hexadecimal entries in sysfs Wolfram Sang
2025-07-07 16:19 ` Frank Li
@ 2025-07-07 21:32 ` Alexandre Belloni
1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2025-07-07 21:32 UTC (permalink / raw)
To: linux-renesas-soc, Wolfram Sang; +Cc: Frank Li, linux-i3c
On Mon, 07 Jul 2025 13:54:08 +0200, Wolfram Sang wrote:
> Hexadecimal values in sysfs should be prefixed with '0x' like e.g. PCI
> and SCSI already do it. Also ensure the two digit length since BCR and
> DCR are a byte in size.
>
>
Applied, thanks!
[1/1] i3c: prefix hexadecimal entries in sysfs
https://git.kernel.org/abelloni/c/12aa3e0cb0c6
Best regards,
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-07-07 21:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-07 11:54 [PATCH] i3c: prefix hexadecimal entries in sysfs Wolfram Sang
2025-07-07 16:19 ` Frank Li
2025-07-07 21:32 ` Alexandre Belloni
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).