public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "K. Y. Srinivasan" <kys@microsoft.com>
To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com,
	vkuznets@redhat.com
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Subject: [PATCH RESEND 2/5] Tools: hv: remove unused bytes_written from kvp_update_file()
Date: Fri,  9 Jan 2015 22:18:52 -0800	[thread overview]
Message-ID: <1420870735-2265-2-git-send-email-kys@microsoft.com> (raw)
In-Reply-To: <1420870735-2265-1-git-send-email-kys@microsoft.com>

From: Vitaly Kuznetsov <vkuznets@redhat.com>

fwrite() does not actually return the number of bytes written and
this value is being ignored anyway and ferror() is being called to
check for an error. As we assign to this variable and never use it
we get the following compile-time warning:
hv_kvp_daemon.c:149:9: warning: variable .bytes_written. set but not used [-Wunused-but-set-variable]
Remove bytes_written completely.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 tools/hv/hv_kvp_daemon.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c
index 6a6432a..5a274ca 100644
--- a/tools/hv/hv_kvp_daemon.c
+++ b/tools/hv/hv_kvp_daemon.c
@@ -147,7 +147,6 @@ static void kvp_release_lock(int pool)
 static void kvp_update_file(int pool)
 {
 	FILE *filep;
-	size_t bytes_written;
 
 	/*
 	 * We are going to write our in-memory registry out to
@@ -163,8 +162,7 @@ static void kvp_update_file(int pool)
 		exit(EXIT_FAILURE);
 	}
 
-	bytes_written = fwrite(kvp_file_info[pool].records,
-				sizeof(struct kvp_record),
+	fwrite(kvp_file_info[pool].records, sizeof(struct kvp_record),
 				kvp_file_info[pool].num_records, filep);
 
 	if (ferror(filep) || fclose(filep)) {
-- 
1.7.4.1


  reply	other threads:[~2015-01-10  5:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-10  6:18 [PATCH RESEND 0/5] Tools: hv: fix compiler warnings and do minor cleanup K. Y. Srinivasan
2015-01-10  6:18 ` [PATCH RESEND 1/5] Tools: hv: add mising fcopyd to the Makefile K. Y. Srinivasan
2015-01-10  6:18   ` K. Y. Srinivasan [this message]
2015-01-10  6:18   ` [PATCH RESEND 3/5] Tools: hv: address compiler warnings for hv_kvp_daemon.c K. Y. Srinivasan
2015-01-10  6:18   ` [PATCH RESEND 4/5] Tools: hv: address compiler warnings for hv_fcopy_daemon.c K. Y. Srinivasan
2015-01-10  6:18   ` [PATCH RESEND 5/5] Tools: hv: do not add redundant '/' in hv_start_fcopy() K. Y. Srinivasan
2015-01-25 13:34   ` [PATCH RESEND 1/5] Tools: hv: add mising fcopyd to the Makefile Greg KH
2015-01-26 10:07     ` Vitaly Kuznetsov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1420870735-2265-2-git-send-email-kys@microsoft.com \
    --to=kys@microsoft.com \
    --cc=apw@canonical.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olaf@aepfle.de \
    --cc=vkuznets@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox