mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: H Hartley Sweeten <hartleys@visionengravers.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] init/initramfs.c: fix "symbol shadows an earlier one" noise
Date: Tue, 4 Aug 2009 13:34:13 -0700	[thread overview]
Message-ID: <200908041334.13758.hartleys@visionengravers.com> (raw)

The symbol 'count' is a static global variable used when unpacking the
rootfs.  Function clean_rootfs() uses this same symbol name locally
while walking the directory entries to clean the rootfs.  This results in
the following sparse warnings:

init/initramfs.c:526:13: warning: symbol 'count' shadows an earlier one
init/initramfs.c:167:28: originally declared here

Fix this by renaming the symbol in clean_rootfs().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>

---

diff --git a/init/initramfs.c b/init/initramfs.c
index 4c00edc..893d0b4 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -523,7 +523,7 @@ static void __init clean_rootfs(void)
 	int fd;
 	void *buf;
 	struct linux_dirent64 *dirp;
-	int count;
+	int dents_count;
 
 	fd = sys_open("/", O_RDONLY, 0);
 	WARN_ON(fd < 0);
@@ -537,9 +537,9 @@ static void __init clean_rootfs(void)
 	}
 
 	dirp = buf;
-	count = sys_getdents64(fd, dirp, BUF_SIZE);
-	while (count > 0) {
-		while (count > 0) {
+	dents_count = sys_getdents64(fd, dirp, BUF_SIZE);
+	while (dents_count > 0) {
+		while (dents_count > 0) {
 			struct stat st;
 			int ret;
 
@@ -552,12 +552,12 @@ static void __init clean_rootfs(void)
 					sys_unlink(dirp->d_name);
 			}
 
-			count -= dirp->d_reclen;
+			dents_count -= dirp->d_reclen;
 			dirp = (void *)dirp + dirp->d_reclen;
 		}
 		dirp = buf;
 		memset(buf, 0, BUF_SIZE);
-		count = sys_getdents64(fd, dirp, BUF_SIZE);
+		dents_count = sys_getdents64(fd, dirp, BUF_SIZE);
 	}
 
 	sys_close(fd);

                 reply	other threads:[~2009-08-04 20:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200908041334.13758.hartleys@visionengravers.com \
    --to=hartleys@visionengravers.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®