From 86a200c11c8213210d46d3c931c9d0a67e9123f3 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sat, 27 Sep 2025 15:28:15 +0200 Subject: [PATCH] Mark up paths in documentation as code Link: https://github.com/rust-vmm/vhost-device/pull/880#pullrequestreview-3250960631 Signed-off-by: Alyssa Ross --- staging/vhost-device-video/src/main.rs | 2 +- staging/vhost-device-video/src/vhu_video.rs | 2 +- vhost-device-i2c/src/i2c.rs | 4 ++-- vhost-device-rng/src/vhu_rng.rs | 2 +- vhost-device-scmi/src/devices/common.rs | 2 +- vhost-device-scmi/src/devices/iio.rs | 4 ++-- vhost-device-spi/src/linux_spi.rs | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/staging/vhost-device-video/src/main.rs b/staging/vhost-device-video/src/main.rs index 353811088..02c6b681b 100644 --- a/staging/vhost-device-video/src/main.rs +++ b/staging/vhost-device-video/src/main.rs @@ -37,7 +37,7 @@ struct VideoArgs { #[clap(short, long)] socket_path: PathBuf, - /// Path to the video device file. Defaults to /dev/video0. + /// Path to the video device file. Defaults to `/dev/video0`. #[clap(short = 'd', long, default_value = "/dev/video0")] v4l2_device: PathBuf, diff --git a/staging/vhost-device-video/src/vhu_video.rs b/staging/vhost-device-video/src/vhu_video.rs index 57c4e1c41..000d8dca5 100644 --- a/staging/vhost-device-video/src/vhu_video.rs +++ b/staging/vhost-device-video/src/vhu_video.rs @@ -131,7 +131,7 @@ pub(crate) struct VuVideoBackend { } impl VuVideoBackend { - /// Create a new virtio video device for /dev/video. + /// Create a new virtio video device for `/dev/video`. pub fn new(video_path: &Path, video_backend: BackendType) -> Result { let backend = Arc::new(RwLock::new(video_backends::alloc_video_backend( video_backend, diff --git a/vhost-device-i2c/src/i2c.rs b/vhost-device-i2c/src/i2c.rs index c0a0fadd5..7094a96bc 100644 --- a/vhost-device-i2c/src/i2c.rs +++ b/vhost-device-i2c/src/i2c.rs @@ -90,7 +90,7 @@ const I2C_FUNC_SMBUS_ALL: u64 = /// I2C protocol definitions pub(crate) const I2C_M_RD: u16 = 0x0001; // read data, from slave to master -/// Copied (partially) from Linux's include/uapi/linux/i2c.h +/// Copied (partially) from Linux's `include/uapi/linux/i2c.h` /// /// I2cMsg - an I2C transaction segment beginning with START /// @@ -185,7 +185,7 @@ pub(crate) struct SmbusMsg { } impl SmbusMsg { - /// Based on Linux's drivers/i2c/i2c-core-smbus.c:i2c_smbus_xfer_emulated(). + /// Based on Linux's `drivers/i2c/i2c-core-smbus.c:i2c_smbus_xfer_emulated()`. /// /// These smbus related functions try to reverse what Linux does, only /// support basic modes (up to word transfer). diff --git a/vhost-device-rng/src/vhu_rng.rs b/vhost-device-rng/src/vhu_rng.rs index 7dfa3566c..5d73cdf2e 100644 --- a/vhost-device-rng/src/vhu_rng.rs +++ b/vhost-device-rng/src/vhu_rng.rs @@ -95,7 +95,7 @@ pub(crate) struct VuRngBackend { } impl VuRngBackend { - /// Create a new virtio rng device that gets random data from /dev/urandom. + /// Create a new virtio rng device that gets random data from `/dev/urandom`. pub fn new( rng_source: Arc>, period_ms: u128, diff --git a/vhost-device-scmi/src/devices/common.rs b/vhost-device-scmi/src/devices/common.rs index fc4e687b4..dd95ee106 100644 --- a/vhost-device-scmi/src/devices/common.rs +++ b/vhost-device-scmi/src/devices/common.rs @@ -239,7 +239,7 @@ pub struct Sensor { notify_enabled: bool, /// If this sensor supports notifying the frontend actively, it should /// record notification device file here. (e.g. For iio device, the file - /// is /dev/iio:deviceX) + /// is `/dev/iio:deviceX`) pub notify_dev: Option, /// Sensor id, to identify the sensor in notification lookup. diff --git a/vhost-device-scmi/src/devices/iio.rs b/vhost-device-scmi/src/devices/iio.rs index 1b140592c..ed07afe38 100644 --- a/vhost-device-scmi/src/devices/iio.rs +++ b/vhost-device-scmi/src/devices/iio.rs @@ -190,7 +190,7 @@ impl ChanScanType { /// The channel scan type follows the rule /// If repeat > 1, "%s:%c%d/%dX%d>>%u\n" /// Else, "%s:%c%d/%d>>%u\n". - /// For more details, see kernel "drivers/iio/industrialio-buffer.c" + /// For more details, see kernel `drivers/iio/industrialio-buffer.c` fn new(value: String) -> Option { let error_message = "Error format from iio device!"; let endianness = match &value[0..2] { @@ -260,7 +260,7 @@ struct Axis { /// `Bit[8]` of axis_attributes_low is set to 1. custom_resolution: u64, /// Channel scan type, necessary if the sensor supports notifications. - /// The data from /dev/iio:deviceX will be formatted according to this. + /// The data from `/dev/iio:deviceX` will be formatted according to this. /// The ChanScanType is parsed from "scan_elements/\_type" scan_type: Option, } diff --git a/vhost-device-spi/src/linux_spi.rs b/vhost-device-spi/src/linux_spi.rs index 595257921..fb1461d66 100644 --- a/vhost-device-spi/src/linux_spi.rs +++ b/vhost-device-spi/src/linux_spi.rs @@ -39,7 +39,7 @@ pub struct SpiIocTransfer { } /// Linux SPI definitions -/// IOCTL commands, refer Linux's Documentation/spi/spidev.rst for further +/// IOCTL commands, refer Linux's `Documentation/spi/spidev.rst` for further /// details. const _IOC_SIZEBITS: u32 = 14; const _IOC_SIZESHIFT: u32 = 16;