Skip to content

Commit 332bf98

Browse files
aloktiwaliuw
authored andcommitted
Drivers: hv: vmbus: Fix sysfs output format for ring buffer index
The sysfs attributes out_read_index and out_write_index in vmbus_drv.c currently use %d to print outbound.current_read_index and outbound.current_write_index. These fields are u32 values, so printing them with %d (signed) is not logically correct. Update the format specifier to %u to correctly match their type. No functional change, only fixes the sysfs output format. Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com> Reviewed-by: Michael Kelley <mhklinux@outlook.com> Signed-off-by: Wei Liu <wei.liu@kernel.org>
1 parent fd9be09 commit 332bf98

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/hv/vmbus_drv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ static ssize_t out_read_index_show(struct device *dev,
322322
&outbound);
323323
if (ret < 0)
324324
return ret;
325-
return sysfs_emit(buf, "%d\n", outbound.current_read_index);
325+
return sysfs_emit(buf, "%u\n", outbound.current_read_index);
326326
}
327327
static DEVICE_ATTR_RO(out_read_index);
328328

@@ -341,7 +341,7 @@ static ssize_t out_write_index_show(struct device *dev,
341341
&outbound);
342342
if (ret < 0)
343343
return ret;
344-
return sysfs_emit(buf, "%d\n", outbound.current_write_index);
344+
return sysfs_emit(buf, "%u\n", outbound.current_write_index);
345345
}
346346
static DEVICE_ATTR_RO(out_write_index);
347347

0 commit comments

Comments
 (0)