diff options
author | Stephen Hemminger <stephen@networkplumber.org> | 2017-03-04 20:27:13 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-03-17 02:10:48 -0400 |
commit | 2c616a8b6bd3b51b560d994f3412da998fe7ee48 (patch) | |
tree | 66ea1204179bb397cc80f90813434e411b58f467 /drivers/hv/ring_buffer.c | |
parent | 8b1f91fb4c1a8a860b8edc0c383821b2ff8a1ece (diff) |
vmbus: remove unnecessary initialization
Don't initialize variables that are then set a few lines later.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hv/ring_buffer.c')
-rw-r--r-- | drivers/hv/ring_buffer.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c index d0ff5b41161a..52d0556a5a25 100644 --- a/drivers/hv/ring_buffer.c +++ b/drivers/hv/ring_buffer.c | |||
@@ -265,14 +265,13 @@ void hv_ringbuffer_cleanup(struct hv_ring_buffer_info *ring_info) | |||
265 | int hv_ringbuffer_write(struct vmbus_channel *channel, | 265 | int hv_ringbuffer_write(struct vmbus_channel *channel, |
266 | const struct kvec *kv_list, u32 kv_count) | 266 | const struct kvec *kv_list, u32 kv_count) |
267 | { | 267 | { |
268 | int i = 0; | 268 | int i; |
269 | u32 bytes_avail_towrite; | 269 | u32 bytes_avail_towrite; |
270 | u32 totalbytes_towrite = 0; | 270 | u32 totalbytes_towrite = sizeof(u64); |
271 | |||
272 | u32 next_write_location; | 271 | u32 next_write_location; |
273 | u32 old_write; | 272 | u32 old_write; |
274 | u64 prev_indices = 0; | 273 | u64 prev_indices; |
275 | unsigned long flags = 0; | 274 | unsigned long flags; |
276 | struct hv_ring_buffer_info *outring_info = &channel->outbound; | 275 | struct hv_ring_buffer_info *outring_info = &channel->outbound; |
277 | 276 | ||
278 | if (channel->rescind) | 277 | if (channel->rescind) |
@@ -281,8 +280,6 @@ int hv_ringbuffer_write(struct vmbus_channel *channel, | |||
281 | for (i = 0; i < kv_count; i++) | 280 | for (i = 0; i < kv_count; i++) |
282 | totalbytes_towrite += kv_list[i].iov_len; | 281 | totalbytes_towrite += kv_list[i].iov_len; |
283 | 282 | ||
284 | totalbytes_towrite += sizeof(u64); | ||
285 | |||
286 | spin_lock_irqsave(&outring_info->ring_lock, flags); | 283 | spin_lock_irqsave(&outring_info->ring_lock, flags); |
287 | 284 | ||
288 | bytes_avail_towrite = hv_get_bytes_to_write(outring_info); | 285 | bytes_avail_towrite = hv_get_bytes_to_write(outring_info); |
@@ -339,7 +336,7 @@ int hv_ringbuffer_read(struct vmbus_channel *channel, | |||
339 | u64 *requestid, bool raw) | 336 | u64 *requestid, bool raw) |
340 | { | 337 | { |
341 | u32 bytes_avail_toread; | 338 | u32 bytes_avail_toread; |
342 | u32 next_read_location = 0; | 339 | u32 next_read_location; |
343 | u64 prev_indices = 0; | 340 | u64 prev_indices = 0; |
344 | struct vmpacket_descriptor desc; | 341 | struct vmpacket_descriptor desc; |
345 | u32 offset; | 342 | u32 offset; |