Skip to content

Commit 12aa3e0

Browse files
Wolfram Sangalexandrebelloni
authored andcommitted
i3c: prefix hexadecimal entries in sysfs
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 <[email protected]> Reviewed-by: Frank Li <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent 8d53c0d commit 12aa3e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/i3c/master.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static ssize_t bcr_show(struct device *dev,
141141

142142
i3c_bus_normaluse_lock(bus);
143143
desc = dev_to_i3cdesc(dev);
144-
ret = sprintf(buf, "%x\n", desc->info.bcr);
144+
ret = sprintf(buf, "0x%02x\n", desc->info.bcr);
145145
i3c_bus_normaluse_unlock(bus);
146146

147147
return ret;
@@ -158,7 +158,7 @@ static ssize_t dcr_show(struct device *dev,
158158

159159
i3c_bus_normaluse_lock(bus);
160160
desc = dev_to_i3cdesc(dev);
161-
ret = sprintf(buf, "%x\n", desc->info.dcr);
161+
ret = sprintf(buf, "0x%02x\n", desc->info.dcr);
162162
i3c_bus_normaluse_unlock(bus);
163163

164164
return ret;

0 commit comments

Comments
 (0)