Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752636AbdCEB3C (ORCPT ); Sat, 4 Mar 2017 20:29:02 -0500 Received: from a2nlsmtp01-02.prod.iad2.secureserver.net ([198.71.225.36]:39128 "EHLO a2nlsmtp01-02.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752391AbdCEB27 (ORCPT ); Sat, 4 Mar 2017 20:28:59 -0500 x-originating-ip: 107.180.71.197 From: kys@exchange.microsoft.com To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, vkuznets@redhat.com, jasowang@redhat.com, leann.ogasawara@canonical.com, marcelo.cerri@canonical.com Cc: Stephen Hemminger , Stephen Hemminger , "K. Y. Srinivasan" Subject: [PATCH 4/9] vmbus: remove unnecessary initialization Date: Sat, 4 Mar 2017 18:27:13 -0700 Message-Id: <1488677238-5150-4-git-send-email-kys@exchange.microsoft.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1488677204-5059-1-git-send-email-kys@exchange.microsoft.com> References: <1488677204-5059-1-git-send-email-kys@exchange.microsoft.com> Reply-To: kys@microsoft.com X-CMAE-Envelope: MS4wfHa6GSBH+aEz0JQs8PU2wVsGTOHfDLl5NyS1WcQVyse5/0Osb8OiU/XNRwjO5wHEWTbsVA1As5P9HsVeRBXb3SQxVzKp66onGc4ukh8UEzxGyaoD6PlJ xNjEluXkTZelJnuVOkcKhUZ9nEUhuJ2VgwqDjlJfMt2DOTrMg9f4+2dcKJGN1YviXIDXCFSYPLV799DM3eyZpDCX8OtDvOCn4iSgJR+Nai3xUuxpOZVc3Zki crlkWQefUV3dDnnQIrhPrwPThGSKxBw+Jxza/TGdw4xKZEMzMeFO6OG6hQzuvBIyY9MVQfNLoasL7TicQAegkQgx/rhv45v+GHLq0XMajm20kqiLgh4OTudE gOS40Fsg8oQD/iwmze6IxTJZu/Xn+TPLZzlZGrk2fKIiYfs2fDbg+nWkH4o7fdPZksahVtJmfWr+QcC/1OgkXYLSgwMtvuC0NOH0eHfpdqVrNw0I78b+gzh3 wahiYzKFYaJXPqPHMQ9pkMcdL9ZsoNuNrwDeGq099QJ8q+z7gJWcBwyR9Ua7vdDwkxfuK0ywnykb1HXvSios58lRwh1sqBLS4iBHcw== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1620 Lines: 53 From: Stephen Hemminger Don't initialize variables that are then set a few lines later. Signed-off-by: Stephen Hemminger Signed-off-by: K. Y. Srinivasan --- 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 d0ff5b4..52d0556 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) int hv_ringbuffer_write(struct vmbus_channel *channel, const struct kvec *kv_list, u32 kv_count) { - int i = 0; + int i; u32 bytes_avail_towrite; - u32 totalbytes_towrite = 0; - + u32 totalbytes_towrite = sizeof(u64); u32 next_write_location; u32 old_write; - u64 prev_indices = 0; - unsigned long flags = 0; + u64 prev_indices; + unsigned long flags; struct hv_ring_buffer_info *outring_info = &channel->outbound; if (channel->rescind) @@ -281,8 +280,6 @@ int hv_ringbuffer_write(struct vmbus_channel *channel, for (i = 0; i < kv_count; i++) totalbytes_towrite += kv_list[i].iov_len; - totalbytes_towrite += sizeof(u64); - spin_lock_irqsave(&outring_info->ring_lock, flags); bytes_avail_towrite = hv_get_bytes_to_write(outring_info); @@ -339,7 +336,7 @@ int hv_ringbuffer_read(struct vmbus_channel *channel, u64 *requestid, bool raw) { u32 bytes_avail_toread; - u32 next_read_location = 0; + u32 next_read_location; u64 prev_indices = 0; struct vmpacket_descriptor desc; u32 offset; -- 1.7.1