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

[Cluster-devel] [PATCH] Clean up unused loop variable



Reading through the gfs2_edit code I noticed that a variable is
initialised and incremented in this for loop but is not used inside the
loop and the final value of the variable is not used subsequently. This
patch removes the initialisation and increment of the variable.

--
Andy Price

Index: gfs2/edit/gfs2hex.c
===================================================================
RCS file: /cvs/cluster/cluster/gfs2/edit/gfs2hex.c,v
retrieving revision 1.14
diff -u -p -r1.14 gfs2hex.c
--- gfs2/edit/gfs2hex.c	15 Nov 2007 20:32:42 -0000	1.14
+++ gfs2/edit/gfs2hex.c	13 Jan 2008 16:11:28 -0000
@@ -226,9 +226,8 @@ void do_dinode_extended(struct gfs2_dino
 	memset(indirect, 0, sizeof(indirect));
 	if (di->di_height > 0) {
 		/* Indirect pointers */
-		for (x = sizeof(struct gfs2_dinode), y = 0;
-			 x < bufsize;
-			 x += sizeof(uint64_t), y++) {
+		for (x = sizeof(struct gfs2_dinode); x < bufsize;
+						 x += sizeof(uint64_t)) {
 			p = be64_to_cpu(*(uint64_t *)(buf + x));
 			if (p) {
 				indirect->ii[indirect_blocks].block = p;

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