aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiang Biao <benbjiang@tencent.com>2019-04-23 06:25:12 -0400
committerMichael S. Tsirkin <mst@redhat.com>2019-05-12 13:11:35 -0400
commita5581206c565a7f1113a84232f734e7135b90a61 (patch)
treecb9dae55f461b15e431b3bb8a9c06ffd9dcc5b24
parent889e31e73a738183a402cf4dbca991dce2abce96 (diff)
virtio/virtio_ring: do some comment fixes
There are lots of mismatches between comments and codes, this patch do these comment fixes. Signed-off-by: Jiang Biao <benbjiang@tencent.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r--drivers/virtio/virtio_ring.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 021010424fa5..0a7b3ce3fb75 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -1719,10 +1719,10 @@ static inline int virtqueue_add(struct virtqueue *_vq,
1719 1719
1720/** 1720/**
1721 * virtqueue_add_sgs - expose buffers to other end 1721 * virtqueue_add_sgs - expose buffers to other end
1722 * @vq: the struct virtqueue we're talking about. 1722 * @_vq: the struct virtqueue we're talking about.
1723 * @sgs: array of terminated scatterlists. 1723 * @sgs: array of terminated scatterlists.
1724 * @out_num: the number of scatterlists readable by other side 1724 * @out_sgs: the number of scatterlists readable by other side
1725 * @in_num: the number of scatterlists which are writable (after readable ones) 1725 * @in_sgs: the number of scatterlists which are writable (after readable ones)
1726 * @data: the token identifying the buffer. 1726 * @data: the token identifying the buffer.
1727 * @gfp: how to do memory allocations (if necessary). 1727 * @gfp: how to do memory allocations (if necessary).
1728 * 1728 *
@@ -1822,7 +1822,7 @@ EXPORT_SYMBOL_GPL(virtqueue_add_inbuf_ctx);
1822 1822
1823/** 1823/**
1824 * virtqueue_kick_prepare - first half of split virtqueue_kick call. 1824 * virtqueue_kick_prepare - first half of split virtqueue_kick call.
1825 * @vq: the struct virtqueue 1825 * @_vq: the struct virtqueue
1826 * 1826 *
1827 * Instead of virtqueue_kick(), you can do: 1827 * Instead of virtqueue_kick(), you can do:
1828 * if (virtqueue_kick_prepare(vq)) 1828 * if (virtqueue_kick_prepare(vq))
@@ -1842,7 +1842,7 @@ EXPORT_SYMBOL_GPL(virtqueue_kick_prepare);
1842 1842
1843/** 1843/**
1844 * virtqueue_notify - second half of split virtqueue_kick call. 1844 * virtqueue_notify - second half of split virtqueue_kick call.
1845 * @vq: the struct virtqueue 1845 * @_vq: the struct virtqueue
1846 * 1846 *
1847 * This does not need to be serialized. 1847 * This does not need to be serialized.
1848 * 1848 *
@@ -1886,8 +1886,9 @@ EXPORT_SYMBOL_GPL(virtqueue_kick);
1886 1886
1887/** 1887/**
1888 * virtqueue_get_buf - get the next used buffer 1888 * virtqueue_get_buf - get the next used buffer
1889 * @vq: the struct virtqueue we're talking about. 1889 * @_vq: the struct virtqueue we're talking about.
1890 * @len: the length written into the buffer 1890 * @len: the length written into the buffer
1891 * @ctx: extra context for the token
1891 * 1892 *
1892 * If the device wrote data into the buffer, @len will be set to the 1893 * If the device wrote data into the buffer, @len will be set to the
1893 * amount written. This means you don't need to clear the buffer 1894 * amount written. This means you don't need to clear the buffer
@@ -1917,7 +1918,7 @@ void *virtqueue_get_buf(struct virtqueue *_vq, unsigned int *len)
1917EXPORT_SYMBOL_GPL(virtqueue_get_buf); 1918EXPORT_SYMBOL_GPL(virtqueue_get_buf);
1918/** 1919/**
1919 * virtqueue_disable_cb - disable callbacks 1920 * virtqueue_disable_cb - disable callbacks
1920 * @vq: the struct virtqueue we're talking about. 1921 * @_vq: the struct virtqueue we're talking about.
1921 * 1922 *
1922 * Note that this is not necessarily synchronous, hence unreliable and only 1923 * Note that this is not necessarily synchronous, hence unreliable and only
1923 * useful as an optimization. 1924 * useful as an optimization.
@@ -1937,7 +1938,7 @@ EXPORT_SYMBOL_GPL(virtqueue_disable_cb);
1937 1938
1938/** 1939/**
1939 * virtqueue_enable_cb_prepare - restart callbacks after disable_cb 1940 * virtqueue_enable_cb_prepare - restart callbacks after disable_cb
1940 * @vq: the struct virtqueue we're talking about. 1941 * @_vq: the struct virtqueue we're talking about.
1941 * 1942 *
1942 * This re-enables callbacks; it returns current queue state 1943 * This re-enables callbacks; it returns current queue state
1943 * in an opaque unsigned value. This value should be later tested by 1944 * in an opaque unsigned value. This value should be later tested by
@@ -1958,7 +1959,7 @@ EXPORT_SYMBOL_GPL(virtqueue_enable_cb_prepare);
1958 1959
1959/** 1960/**
1960 * virtqueue_poll - query pending used buffers 1961 * virtqueue_poll - query pending used buffers
1961 * @vq: the struct virtqueue we're talking about. 1962 * @_vq: the struct virtqueue we're talking about.
1962 * @last_used_idx: virtqueue state (from call to virtqueue_enable_cb_prepare). 1963 * @last_used_idx: virtqueue state (from call to virtqueue_enable_cb_prepare).
1963 * 1964 *
1964 * Returns "true" if there are pending used buffers in the queue. 1965 * Returns "true" if there are pending used buffers in the queue.
@@ -1977,7 +1978,7 @@ EXPORT_SYMBOL_GPL(virtqueue_poll);
1977 1978
1978/** 1979/**
1979 * virtqueue_enable_cb - restart callbacks after disable_cb. 1980 * virtqueue_enable_cb - restart callbacks after disable_cb.
1980 * @vq: the struct virtqueue we're talking about. 1981 * @_vq: the struct virtqueue we're talking about.
1981 * 1982 *
1982 * This re-enables callbacks; it returns "false" if there are pending 1983 * This re-enables callbacks; it returns "false" if there are pending
1983 * buffers in the queue, to detect a possible race between the driver 1984 * buffers in the queue, to detect a possible race between the driver
@@ -1996,7 +1997,7 @@ EXPORT_SYMBOL_GPL(virtqueue_enable_cb);
1996 1997
1997/** 1998/**
1998 * virtqueue_enable_cb_delayed - restart callbacks after disable_cb. 1999 * virtqueue_enable_cb_delayed - restart callbacks after disable_cb.
1999 * @vq: the struct virtqueue we're talking about. 2000 * @_vq: the struct virtqueue we're talking about.
2000 * 2001 *
2001 * This re-enables callbacks but hints to the other side to delay 2002 * This re-enables callbacks but hints to the other side to delay
2002 * interrupts until most of the available buffers have been processed; 2003 * interrupts until most of the available buffers have been processed;
@@ -2018,7 +2019,7 @@ EXPORT_SYMBOL_GPL(virtqueue_enable_cb_delayed);
2018 2019
2019/** 2020/**
2020 * virtqueue_detach_unused_buf - detach first unused buffer 2021 * virtqueue_detach_unused_buf - detach first unused buffer
2021 * @vq: the struct virtqueue we're talking about. 2022 * @_vq: the struct virtqueue we're talking about.
2022 * 2023 *
2023 * Returns NULL or the "data" token handed to virtqueue_add_*(). 2024 * Returns NULL or the "data" token handed to virtqueue_add_*().
2024 * This is not valid on an active queue; it is useful only for device 2025 * This is not valid on an active queue; it is useful only for device
@@ -2250,7 +2251,7 @@ EXPORT_SYMBOL_GPL(vring_transport_features);
2250 2251
2251/** 2252/**
2252 * virtqueue_get_vring_size - return the size of the virtqueue's vring 2253 * virtqueue_get_vring_size - return the size of the virtqueue's vring
2253 * @vq: the struct virtqueue containing the vring of interest. 2254 * @_vq: the struct virtqueue containing the vring of interest.
2254 * 2255 *
2255 * Returns the size of the vring. This is mainly used for boasting to 2256 * Returns the size of the vring. This is mainly used for boasting to
2256 * userspace. Unlike other operations, this need not be serialized. 2257 * userspace. Unlike other operations, this need not be serialized.