diff options
Diffstat (limited to 'drivers/hv/ring_buffer.c')
-rw-r--r-- | drivers/hv/ring_buffer.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c index 8af25a097d75..7233c88f01b8 100644 --- a/drivers/hv/ring_buffer.c +++ b/drivers/hv/ring_buffer.c | |||
@@ -30,37 +30,6 @@ | |||
30 | #include "hyperv_vmbus.h" | 30 | #include "hyperv_vmbus.h" |
31 | 31 | ||
32 | 32 | ||
33 | /* #defines */ | ||
34 | |||
35 | |||
36 | /* Amount of space to write to */ | ||
37 | #define BYTES_AVAIL_TO_WRITE(r, w, z) \ | ||
38 | ((w) >= (r)) ? ((z) - ((w) - (r))) : ((r) - (w)) | ||
39 | |||
40 | |||
41 | /* | ||
42 | * | ||
43 | * hv_get_ringbuffer_availbytes() | ||
44 | * | ||
45 | * Get number of bytes available to read and to write to | ||
46 | * for the specified ring buffer | ||
47 | */ | ||
48 | static inline void | ||
49 | hv_get_ringbuffer_availbytes(struct hv_ring_buffer_info *rbi, | ||
50 | u32 *read, u32 *write) | ||
51 | { | ||
52 | u32 read_loc, write_loc; | ||
53 | |||
54 | smp_read_barrier_depends(); | ||
55 | |||
56 | /* Capture the read/write indices before they changed */ | ||
57 | read_loc = rbi->ring_buffer->read_index; | ||
58 | write_loc = rbi->ring_buffer->write_index; | ||
59 | |||
60 | *write = BYTES_AVAIL_TO_WRITE(read_loc, write_loc, rbi->ring_datasize); | ||
61 | *read = rbi->ring_datasize - *write; | ||
62 | } | ||
63 | |||
64 | /* | 33 | /* |
65 | * hv_get_next_write_location() | 34 | * hv_get_next_write_location() |
66 | * | 35 | * |