* [PATCH] init/initramfs.c: fix "symbol shadows an earlier one" noise
@ 2009-08-04 20:34 H Hartley Sweeten
0 siblings, 0 replies; only message in thread
From: H Hartley Sweeten @ 2009-08-04 20:34 UTC (permalink / raw)
To: Linux Kernel
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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-08-04 20:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-04 20:34 [PATCH] init/initramfs.c: fix "symbol shadows an earlier one" noise H Hartley Sweeten
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®