Commit 3807acbd authored by Vitaly Kuznetsov's avatar Vitaly Kuznetsov Committed by Sasha Levin

Drivers: hv: ring_buffer.c: fix comment style

[ Upstream commit 822f18d4 ]

Convert 6+-string comments repeating function names to normal kernel-style
comments and fix a couple of other comment style issues. No textual or
functional changes intended.
Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
parent 9ddd8340
...@@ -113,9 +113,7 @@ static bool hv_need_to_signal_on_read(u32 old_rd, ...@@ -113,9 +113,7 @@ static bool hv_need_to_signal_on_read(u32 old_rd,
u32 read_loc = rbi->ring_buffer->read_index; u32 read_loc = rbi->ring_buffer->read_index;
u32 pending_sz = rbi->ring_buffer->pending_send_sz; u32 pending_sz = rbi->ring_buffer->pending_send_sz;
/* /* If the other end is not blocked on write don't bother. */
* If the other end is not blocked on write don't bother.
*/
if (pending_sz == 0) if (pending_sz == 0)
return false; return false;
...@@ -133,12 +131,7 @@ static bool hv_need_to_signal_on_read(u32 old_rd, ...@@ -133,12 +131,7 @@ static bool hv_need_to_signal_on_read(u32 old_rd,
return false; return false;
} }
/* /* Get the next write location for the specified ring buffer. */
* hv_get_next_write_location()
*
* Get the next write location for the specified ring buffer
*
*/
static inline u32 static inline u32
hv_get_next_write_location(struct hv_ring_buffer_info *ring_info) hv_get_next_write_location(struct hv_ring_buffer_info *ring_info)
{ {
...@@ -147,12 +140,7 @@ hv_get_next_write_location(struct hv_ring_buffer_info *ring_info) ...@@ -147,12 +140,7 @@ hv_get_next_write_location(struct hv_ring_buffer_info *ring_info)
return next; return next;
} }
/* /* Set the next write location for the specified ring buffer. */
* hv_set_next_write_location()
*
* Set the next write location for the specified ring buffer
*
*/
static inline void static inline void
hv_set_next_write_location(struct hv_ring_buffer_info *ring_info, hv_set_next_write_location(struct hv_ring_buffer_info *ring_info,
u32 next_write_location) u32 next_write_location)
...@@ -160,11 +148,7 @@ hv_set_next_write_location(struct hv_ring_buffer_info *ring_info, ...@@ -160,11 +148,7 @@ hv_set_next_write_location(struct hv_ring_buffer_info *ring_info,
ring_info->ring_buffer->write_index = next_write_location; ring_info->ring_buffer->write_index = next_write_location;
} }
/* /* Get the next read location for the specified ring buffer. */
* hv_get_next_read_location()
*
* Get the next read location for the specified ring buffer
*/
static inline u32 static inline u32
hv_get_next_read_location(struct hv_ring_buffer_info *ring_info) hv_get_next_read_location(struct hv_ring_buffer_info *ring_info)
{ {
...@@ -174,10 +158,8 @@ hv_get_next_read_location(struct hv_ring_buffer_info *ring_info) ...@@ -174,10 +158,8 @@ hv_get_next_read_location(struct hv_ring_buffer_info *ring_info)
} }
/* /*
* hv_get_next_readlocation_withoffset()
*
* Get the next read location + offset for the specified ring buffer. * Get the next read location + offset for the specified ring buffer.
* This allows the caller to skip * This allows the caller to skip.
*/ */
static inline u32 static inline u32
hv_get_next_readlocation_withoffset(struct hv_ring_buffer_info *ring_info, hv_get_next_readlocation_withoffset(struct hv_ring_buffer_info *ring_info,
...@@ -191,13 +173,7 @@ hv_get_next_readlocation_withoffset(struct hv_ring_buffer_info *ring_info, ...@@ -191,13 +173,7 @@ hv_get_next_readlocation_withoffset(struct hv_ring_buffer_info *ring_info,
return next; return next;
} }
/* /* Set the next read location for the specified ring buffer. */
*
* hv_set_next_read_location()
*
* Set the next read location for the specified ring buffer
*
*/
static inline void static inline void
hv_set_next_read_location(struct hv_ring_buffer_info *ring_info, hv_set_next_read_location(struct hv_ring_buffer_info *ring_info,
u32 next_read_location) u32 next_read_location)
...@@ -206,12 +182,7 @@ hv_set_next_read_location(struct hv_ring_buffer_info *ring_info, ...@@ -206,12 +182,7 @@ hv_set_next_read_location(struct hv_ring_buffer_info *ring_info,
} }
/* /* Get the start of the ring buffer. */
*
* hv_get_ring_buffer()
*
* Get the start of the ring buffer
*/
static inline void * static inline void *
hv_get_ring_buffer(struct hv_ring_buffer_info *ring_info) hv_get_ring_buffer(struct hv_ring_buffer_info *ring_info)
{ {
...@@ -219,25 +190,14 @@ hv_get_ring_buffer(struct hv_ring_buffer_info *ring_info) ...@@ -219,25 +190,14 @@ hv_get_ring_buffer(struct hv_ring_buffer_info *ring_info)
} }
/* /* Get the size of the ring buffer. */
*
* hv_get_ring_buffersize()
*
* Get the size of the ring buffer
*/
static inline u32 static inline u32
hv_get_ring_buffersize(struct hv_ring_buffer_info *ring_info) hv_get_ring_buffersize(struct hv_ring_buffer_info *ring_info)
{ {
return ring_info->ring_datasize; return ring_info->ring_datasize;
} }
/* /* Get the read and write indices as u64 of the specified ring buffer. */
*
* hv_get_ring_bufferindices()
*
* Get the read and write indices as u64 of the specified ring buffer
*
*/
static inline u64 static inline u64
hv_get_ring_bufferindices(struct hv_ring_buffer_info *ring_info) hv_get_ring_bufferindices(struct hv_ring_buffer_info *ring_info)
{ {
...@@ -245,12 +205,8 @@ hv_get_ring_bufferindices(struct hv_ring_buffer_info *ring_info) ...@@ -245,12 +205,8 @@ hv_get_ring_bufferindices(struct hv_ring_buffer_info *ring_info)
} }
/* /*
*
* hv_copyfrom_ringbuffer()
*
* Helper routine to copy to source from ring buffer. * Helper routine to copy to source from ring buffer.
* Assume there is enough room. Handles wrap-around in src case only!! * Assume there is enough room. Handles wrap-around in src case only!!
*
*/ */
static u32 hv_copyfrom_ringbuffer( static u32 hv_copyfrom_ringbuffer(
struct hv_ring_buffer_info *ring_info, struct hv_ring_buffer_info *ring_info,
...@@ -282,12 +238,8 @@ static u32 hv_copyfrom_ringbuffer( ...@@ -282,12 +238,8 @@ static u32 hv_copyfrom_ringbuffer(
/* /*
*
* hv_copyto_ringbuffer()
*
* Helper routine to copy from source to ring buffer. * Helper routine to copy from source to ring buffer.
* Assume there is enough room. Handles wrap-around in dest case only!! * Assume there is enough room. Handles wrap-around in dest case only!!
*
*/ */
static u32 hv_copyto_ringbuffer( static u32 hv_copyto_ringbuffer(
struct hv_ring_buffer_info *ring_info, struct hv_ring_buffer_info *ring_info,
...@@ -313,13 +265,7 @@ static u32 hv_copyto_ringbuffer( ...@@ -313,13 +265,7 @@ static u32 hv_copyto_ringbuffer(
return start_write_offset; return start_write_offset;
} }
/* /* Get various debug metrics for the specified ring buffer. */
*
* hv_ringbuffer_get_debuginfo()
*
* Get various debug metrics for the specified ring buffer
*
*/
void hv_ringbuffer_get_debuginfo(struct hv_ring_buffer_info *ring_info, void hv_ringbuffer_get_debuginfo(struct hv_ring_buffer_info *ring_info,
struct hv_ring_buffer_debug_info *debug_info) struct hv_ring_buffer_debug_info *debug_info)
{ {
...@@ -342,13 +288,7 @@ void hv_ringbuffer_get_debuginfo(struct hv_ring_buffer_info *ring_info, ...@@ -342,13 +288,7 @@ void hv_ringbuffer_get_debuginfo(struct hv_ring_buffer_info *ring_info,
} }
} }
/* /* Initialize the ring buffer. */
*
* hv_ringbuffer_init()
*
*Initialize the ring buffer
*
*/
int hv_ringbuffer_init(struct hv_ring_buffer_info *ring_info, int hv_ringbuffer_init(struct hv_ring_buffer_info *ring_info,
void *buffer, u32 buflen) void *buffer, u32 buflen)
{ {
...@@ -361,9 +301,7 @@ int hv_ringbuffer_init(struct hv_ring_buffer_info *ring_info, ...@@ -361,9 +301,7 @@ int hv_ringbuffer_init(struct hv_ring_buffer_info *ring_info,
ring_info->ring_buffer->read_index = ring_info->ring_buffer->read_index =
ring_info->ring_buffer->write_index = 0; ring_info->ring_buffer->write_index = 0;
/* /* Set the feature bit for enabling flow control. */
* Set the feature bit for enabling flow control.
*/
ring_info->ring_buffer->feature_bits.value = 1; ring_info->ring_buffer->feature_bits.value = 1;
ring_info->ring_size = buflen; ring_info->ring_size = buflen;
...@@ -374,24 +312,12 @@ int hv_ringbuffer_init(struct hv_ring_buffer_info *ring_info, ...@@ -374,24 +312,12 @@ int hv_ringbuffer_init(struct hv_ring_buffer_info *ring_info,
return 0; return 0;
} }
/* /* Cleanup the ring buffer. */
*
* hv_ringbuffer_cleanup()
*
* Cleanup the ring buffer
*
*/
void hv_ringbuffer_cleanup(struct hv_ring_buffer_info *ring_info) void hv_ringbuffer_cleanup(struct hv_ring_buffer_info *ring_info)
{ {
} }
/* /* Write to the ring buffer. */
*
* hv_ringbuffer_write()
*
* Write to the ring buffer
*
*/
int hv_ringbuffer_write(struct hv_ring_buffer_info *outring_info, int hv_ringbuffer_write(struct hv_ring_buffer_info *outring_info,
struct kvec *kv_list, u32 kv_count, bool *signal) struct kvec *kv_list, u32 kv_count, bool *signal)
{ {
...@@ -416,10 +342,11 @@ int hv_ringbuffer_write(struct hv_ring_buffer_info *outring_info, ...@@ -416,10 +342,11 @@ int hv_ringbuffer_write(struct hv_ring_buffer_info *outring_info,
&bytes_avail_toread, &bytes_avail_toread,
&bytes_avail_towrite); &bytes_avail_towrite);
/*
/* If there is only room for the packet, assume it is full. */ * If there is only room for the packet, assume it is full.
/* Otherwise, the next time around, we think the ring buffer */ * Otherwise, the next time around, we think the ring buffer
/* is empty since the read index == write index */ * is empty since the read index == write index.
*/
if (bytes_avail_towrite <= totalbytes_towrite) { if (bytes_avail_towrite <= totalbytes_towrite) {
spin_unlock_irqrestore(&outring_info->ring_lock, flags); spin_unlock_irqrestore(&outring_info->ring_lock, flags);
return -EAGAIN; return -EAGAIN;
...@@ -459,13 +386,7 @@ int hv_ringbuffer_write(struct hv_ring_buffer_info *outring_info, ...@@ -459,13 +386,7 @@ int hv_ringbuffer_write(struct hv_ring_buffer_info *outring_info,
} }
/* /* Read without advancing the read index. */
*
* hv_ringbuffer_peek()
*
* Read without advancing the read index
*
*/
int hv_ringbuffer_peek(struct hv_ring_buffer_info *Inring_info, int hv_ringbuffer_peek(struct hv_ring_buffer_info *Inring_info,
void *Buffer, u32 buflen) void *Buffer, u32 buflen)
{ {
...@@ -502,13 +423,7 @@ int hv_ringbuffer_peek(struct hv_ring_buffer_info *Inring_info, ...@@ -502,13 +423,7 @@ int hv_ringbuffer_peek(struct hv_ring_buffer_info *Inring_info,
} }
/* /* Read and advance the read index. */
*
* hv_ringbuffer_read()
*
* Read and advance the read index
*
*/
int hv_ringbuffer_read(struct hv_ring_buffer_info *inring_info, void *buffer, int hv_ringbuffer_read(struct hv_ring_buffer_info *inring_info, void *buffer,
u32 buflen, u32 offset, bool *signal) u32 buflen, u32 offset, bool *signal)
{ {
...@@ -550,9 +465,11 @@ int hv_ringbuffer_read(struct hv_ring_buffer_info *inring_info, void *buffer, ...@@ -550,9 +465,11 @@ int hv_ringbuffer_read(struct hv_ring_buffer_info *inring_info, void *buffer,
sizeof(u64), sizeof(u64),
next_read_location); next_read_location);
/* Make sure all reads are done before we update the read index since */ /*
/* the writer may start writing to the read area once the read index */ * Make sure all reads are done before we update the read index since
/*is updated */ * the writer may start writing to the read area once the read index
* is updated.
*/
mb(); mb();
/* Update the read index */ /* Update the read index */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment