NeilBrown: ddf: fix variable name overload

Martin F. Krafft madduck at alioth.debian.org
Thu May 7 12:11:35 UTC 2009


Module: mdadm
Branch: debian/experimental
Commit: e223334fe720c927301712f6b4944d58e415ac96
URL:    http://git.debian.org/?p=pkg-mdadm/mdadm.git;a=commit;h=e223334fe720c927301712f6b4944d58e415ac96

Author: NeilBrown <neilb at suse.de>
Date:   Tue Apr  7 17:38:25 2009 +1000

ddf: fix variable name overload

The variable 'i' was being used as a loop variable, and also
for something else inside the loop.   So make the larger loop have a
more meaningful name.

Signed-off-by: NeilBrown <neilb at suse.de>

---

 super-ddf.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/super-ddf.c b/super-ddf.c
index 7cc5ac6..feb6621 100644
--- a/super-ddf.c
+++ b/super-ddf.c
@@ -643,6 +643,7 @@ static int load_ddf_local(int fd, struct ddf_super *super,
 	struct stat stb;
 	char *conf;
 	int i;
+	int confsec;
 	int vnum;
 	int max_virt_disks = __be16_to_cpu(super->active->max_vd_entries);
 	unsigned long long dsize;
@@ -693,11 +694,11 @@ static int load_ddf_local(int fd, struct ddf_super *super,
 			    0);
 
 	vnum = 0;
-	for (i = 0;
-	     i < __be32_to_cpu(super->active->config_section_length);
-	     i += super->conf_rec_len) {
+	for (confsec = 0;
+	     confsec < __be32_to_cpu(super->active->config_section_length);
+	     confsec += super->conf_rec_len) {
 		struct vd_config *vd =
-			(struct vd_config *)((char*)conf + i*512);
+			(struct vd_config *)((char*)conf + confsec*512);
 		struct vcl *vcl;
 
 		if (vd->magic == DDF_SPARE_ASSIGN_MAGIC) {




More information about the pkg-mdadm-commits mailing list