]> Gentwo Git Trees - linux/.git/commitdiff
Drivers: hv: vmbus: Fix sysfs output format for ring buffer index
authorAlok Tiwari <alok.a.tiwari@oracle.com>
Sat, 13 Sep 2025 19:24:42 +0000 (12:24 -0700)
committerWei Liu <wei.liu@kernel.org>
Tue, 30 Sep 2025 23:31:00 +0000 (23:31 +0000)
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>
drivers/hv/vmbus_drv.c

index 478c4a76896c41ef79f187cb6d7019c7147531e9..fbab9f2d7fa6538245f11141efef215927b4c181 100644 (file)
@@ -322,7 +322,7 @@ static ssize_t out_read_index_show(struct device *dev,
                                          &outbound);
        if (ret < 0)
                return ret;
-       return sysfs_emit(buf, "%d\n", outbound.current_read_index);
+       return sysfs_emit(buf, "%u\n", outbound.current_read_index);
 }
 static DEVICE_ATTR_RO(out_read_index);
 
@@ -341,7 +341,7 @@ static ssize_t out_write_index_show(struct device *dev,
                                          &outbound);
        if (ret < 0)
                return ret;
-       return sysfs_emit(buf, "%d\n", outbound.current_write_index);
+       return sysfs_emit(buf, "%u\n", outbound.current_write_index);
 }
 static DEVICE_ATTR_RO(out_write_index);