Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8aaed5b

Browse files
H Hartley Sweetentorvalds
authored andcommitted
init/initramfs.c: fix "symbol shadows an earlier one" noise
The symbol 'count' is a local global variable in this file. The function clean_rootfs() should use a different symbol name to prevent "symbol shadows an earlier one" noise. Signed-off-by: H Hartley Sweeten <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 9a85b8d commit 8aaed5b

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

init/initramfs.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ static void __init clean_rootfs(void)
525525
int fd;
526526
void *buf;
527527
struct linux_dirent64 *dirp;
528-
int count;
528+
int num;
529529

530530
fd = sys_open("/", O_RDONLY, 0);
531531
WARN_ON(fd < 0);
@@ -539,9 +539,9 @@ static void __init clean_rootfs(void)
539539
}
540540

541541
dirp = buf;
542-
count = sys_getdents64(fd, dirp, BUF_SIZE);
543-
while (count > 0) {
544-
while (count > 0) {
542+
num = sys_getdents64(fd, dirp, BUF_SIZE);
543+
while (num > 0) {
544+
while (num > 0) {
545545
struct stat st;
546546
int ret;
547547

@@ -554,12 +554,12 @@ static void __init clean_rootfs(void)
554554
sys_unlink(dirp->d_name);
555555
}
556556

557-
count -= dirp->d_reclen;
557+
num -= dirp->d_reclen;
558558
dirp = (void *)dirp + dirp->d_reclen;
559559
}
560560
dirp = buf;
561561
memset(buf, 0, BUF_SIZE);
562-
count = sys_getdents64(fd, dirp, BUF_SIZE);
562+
num = sys_getdents64(fd, dirp, BUF_SIZE);
563563
}
564564

565565
sys_close(fd);

0 commit comments

Comments
 (0)