[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] [PATCH 3/4] 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>
---
 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..40e256d 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)
-- 
1.6.3.3


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]