Module Name: src
Committed By: maxv
Date: Fri Dec 6 08:35:21 UTC 2019
Modified Files:
src/sys/arch/amd64/amd64: machdep.c
src/sys/compat/common: compat_sysctl_09_43.c
src/sys/kern: tty_subr.c
Log Message:
Fix a bunch of unimportant "Local variable hides global variable" warnings
from the LGTM bot.
To generate a diff of this commit:
cvs rdiff -u -r1.341 -r1.342 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/common/compat_sysctl_09_43.c
cvs rdiff -u -r1.41 -r1.42 src/sys/kern/tty_subr.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.341 src/sys/arch/amd64/amd64/machdep.c:1.342
--- src/sys/arch/amd64/amd64/machdep.c:1.341 Thu Nov 14 17:09:23 2019
+++ src/sys/arch/amd64/amd64/machdep.c Fri Dec 6 08:35:21 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.341 2019/11/14 17:09:23 maxv Exp $ */
+/* $NetBSD: machdep.c,v 1.342 2019/12/06 08:35:21 maxv Exp $ */
/*
* Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -110,7 +110,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.341 2019/11/14 17:09:23 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.342 2019/12/06 08:35:21 maxv Exp $");
#include "opt_modular.h"
#include "opt_user_ldt.h"
@@ -912,25 +912,25 @@ dump_seg_iter(int (*callback)(paddr_t, p
* dump will always be smaller than a full one.
*/
if (sparse_dump && sparse_dump_physmap) {
- paddr_t p, start, end;
+ paddr_t p, sp_start, sp_end;
int lastset;
- start = mem_clusters[i].start;
- end = start + mem_clusters[i].size;
- start = rounddown(start, PAGE_SIZE); /* unnecessary? */
+ sp_start = mem_clusters[i].start;
+ sp_end = sp_start + mem_clusters[i].size;
+ sp_start = rounddown(sp_start, PAGE_SIZE); /* unnecessary? */
lastset = 0;
- for (p = start; p < end; p += PAGE_SIZE) {
+ for (p = sp_start; p < sp_end; p += PAGE_SIZE) {
int thisset = isset(sparse_dump_physmap,
p/PAGE_SIZE);
if (!lastset && thisset)
- start = p;
+ sp_start = p;
if (lastset && !thisset)
- CALLBACK(start, p - start);
+ CALLBACK(sp_start, p - sp_start);
lastset = thisset;
}
if (lastset)
- CALLBACK(start, p - start);
+ CALLBACK(sp_start, p - sp_start);
} else
#endif
CALLBACK(mem_clusters[i].start, mem_clusters[i].size);
Index: src/sys/compat/common/compat_sysctl_09_43.c
diff -u src/sys/compat/common/compat_sysctl_09_43.c:1.2 src/sys/compat/common/compat_sysctl_09_43.c:1.3
--- src/sys/compat/common/compat_sysctl_09_43.c:1.2 Sun Jan 27 02:08:39 2019
+++ src/sys/compat/common/compat_sysctl_09_43.c Fri Dec 6 08:35:21 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_sysctl_09_43.c,v 1.2 2019/01/27 02:08:39 pgoyette Exp $ */
+/* $NetBSD: compat_sysctl_09_43.c,v 1.3 2019/12/06 08:35:21 maxv Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat_sysctl_09_43.c,v 1.2 2019/01/27 02:08:39 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_sysctl_09_43.c,v 1.3 2019/12/06 08:35:21 maxv Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@@ -129,20 +129,20 @@ compat_sysctl_vfs(struct sysctllog **clo
}
#endif
-static struct sysctllog *clog = NULL;
+static struct sysctllog *compat_09_43_clog = NULL;
int
compat_sysctl_09_43_init(void)
{
- return compat_sysctl_vfs(&clog);
+ return compat_sysctl_vfs(&compat_09_43_clog);
}
int
compat_sysctl_09_43_fini(void)
{
- sysctl_teardown(&clog);
+ sysctl_teardown(&compat_09_43_clog);
return 0;
}
Index: src/sys/kern/tty_subr.c
diff -u src/sys/kern/tty_subr.c:1.41 src/sys/kern/tty_subr.c:1.42
--- src/sys/kern/tty_subr.c:1.41 Thu Jun 1 02:45:13 2017
+++ src/sys/kern/tty_subr.c Fri Dec 6 08:35:21 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: tty_subr.c,v 1.41 2017/06/01 02:45:13 chs Exp $ */
+/* $NetBSD: tty_subr.c,v 1.42 2019/12/06 08:35:21 maxv Exp $ */
/*
* Copyright (c) 1993, 1994 Theo de Raadt
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tty_subr.c,v 1.41 2017/06/01 02:45:13 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty_subr.c,v 1.42 2019/12/06 08:35:21 maxv Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -378,7 +378,7 @@ out:
return count;
}
-static int cc;
+static int tty_global_cc;
/*
* Given a non-NULL pointer into the clist return the pointer
@@ -396,11 +396,11 @@ nextc(struct clist *clp, u_char *cp, int
/*
* First time initialization.
*/
- cc = clp->c_cc;
+ tty_global_cc = clp->c_cc;
}
- if (cc == 0 || cp == NULL)
+ if (tty_global_cc == 0 || cp == NULL)
return NULL;
- if (--cc == 0)
+ if (--tty_global_cc == 0)
return NULL;
if (++cp == clp->c_ce)
cp = clp->c_cs;
@@ -432,8 +432,8 @@ firstc(struct clist *clp, int *c)
{
u_char *cp;
- cc = clp->c_cc;
- if (cc == 0)
+ tty_global_cc = clp->c_cc;
+ if (tty_global_cc == 0)
return NULL;
cp = clp->c_cf;
*c = *cp & 0xff;