Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Alok Tiwari and committed by
Wei Liu
332bf98d fd9be098

+2 -2
+2 -2
drivers/hv/vmbus_drv.c
··· 322 322 &outbound); 323 323 if (ret < 0) 324 324 return ret; 325 - return sysfs_emit(buf, "%d\n", outbound.current_read_index); 325 + return sysfs_emit(buf, "%u\n", outbound.current_read_index); 326 326 } 327 327 static DEVICE_ATTR_RO(out_read_index); 328 328 ··· 341 341 &outbound); 342 342 if (ret < 0) 343 343 return ret; 344 - return sysfs_emit(buf, "%d\n", outbound.current_write_index); 344 + return sysfs_emit(buf, "%u\n", outbound.current_write_index); 345 345 } 346 346 static DEVICE_ATTR_RO(out_write_index); 347 347