public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* gfs2-utils: master - libgfs2: Fix "Value stored is never read" warnings
@ 2009-08-19 13:33 andyp
  0 siblings, 0 replies; only message in thread
From: andyp @ 2009-08-19 13:33 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=16e8ab95f9db8dd2ab3c9e0b5c5b062c62c2dcd8
Commit:        16e8ab95f9db8dd2ab3c9e0b5c5b062c62c2dcd8
Parent:        075fdcfb97f143f19991820cbc180d1952b043a4
Author:        Andrew Price <andy@andrewprice.me.uk>
AuthorDate:    Wed Aug 19 09:24:33 2009 +0100
Committer:     Andrew Price <andy@andrewprice.me.uk>
CommitterDate: Wed Aug 19 14:28:21 2009 +0100

libgfs2: Fix "Value stored is never read" warnings

Building with CC="clang --analyze" gave the following warnings:

- misc.c:126:8: warning: Although the value stored to 'ret' is used in
  the enclosing expression, the value is never actually read from 'ret'
- fs_geometry.c:82:3: warning: Value stored to 'rgsize_specified' is
  never read
- gfs1.c:308:3: warning: Value stored to 'f' is never read

This patch makes them go away.

Signed-off-by: Andrew Price <andy@andrewprice.me.uk>
Acked-by: Bob Peterson <rpeterso@redhat.com>
---
 gfs2/libgfs2/fs_geometry.c |    1 -
 gfs2/libgfs2/gfs1.c        |    3 ---
 gfs2/libgfs2/misc.c        |    6 +++---
 3 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/gfs2/libgfs2/fs_geometry.c b/gfs2/libgfs2/fs_geometry.c
index e02cc22..1f7b293 100644
--- a/gfs2/libgfs2/fs_geometry.c
+++ b/gfs2/libgfs2/fs_geometry.c
@@ -79,7 +79,6 @@ void compute_rgrp_layout(struct gfs2_sbd *sdp, int rgsize_specified)
 		uint64_t old_length, new_chunk;
 
 		log_info("Existing resource groups:\n");
-		rgsize_specified = TRUE; /* consistently use existing size */
 		for (rgrp = 0, tmp = head->next; tmp != head;
 		     tmp = tmp->next, rgrp++) {
 			rl = osi_list_entry(tmp, struct rgrp_list, list);
diff --git a/gfs2/libgfs2/gfs1.c b/gfs2/libgfs2/gfs1.c
index b87e895..5cca91d 100644
--- a/gfs2/libgfs2/gfs1.c
+++ b/gfs2/libgfs2/gfs1.c
@@ -303,9 +303,6 @@ int gfs1_ri_update(struct gfs2_sbd *sdp, int fd, int *rgcount)
 	if (gfs1_rindex_read(sdp, fd, &count1))
 	    goto fail;
 	for (tmp = sdp->rglist.next; tmp != &sdp->rglist; tmp = tmp->next) {
-		enum update_flags f;
-
-		f = not_updated;
 		rgd = osi_list_entry(tmp, struct rgrp_list, list);
 		errblock = gfs2_rgrp_read(sdp, rgd);
 		if (errblock)
diff --git a/gfs2/libgfs2/misc.c b/gfs2/libgfs2/misc.c
index 87e1e30..a315ebc 100644
--- a/gfs2/libgfs2/misc.c
+++ b/gfs2/libgfs2/misc.c
@@ -123,9 +123,9 @@ int check_for_gfs2(struct gfs2_sbd *sdp)
 		if (strstr(buffer, "0") == 0)
 			continue;
 
-		if ((ret = sscanf(buffer, "%s %s %s %s %d %d",
-				  sdp->device_name, fspath, 
-				  fstype, fsoptions, &fsdump, &fspass)) != 6) 
+		ret = sscanf(buffer, "%s %s %s %s %d %d", sdp->device_name,
+				fspath, fstype, fsoptions, &fsdump, &fspass);
+		if (6 != ret)
 			continue;
 
 		if (strcmp(fstype, "gfs2") != 0)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-08-19 13:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-19 13:33 gfs2-utils: master - libgfs2: Fix "Value stored is never read" warnings andyp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).