Fri Dec 6 08:35:21 2019 UTC ()
Fix a bunch of unimportant "Local variable hides global variable" warnings
from the LGTM bot.


(maxv)
diff -r1.341 -r1.342 src/sys/arch/amd64/amd64/machdep.c
diff -r1.2 -r1.3 src/sys/compat/common/compat_sysctl_09_43.c
diff -r1.41 -r1.42 src/sys/kern/tty_subr.c

cvs diff -r1.341 -r1.342 src/sys/arch/amd64/amd64/machdep.c (expand / switch to context diff)
--- src/sys/arch/amd64/amd64/machdep.c 2019/11/14 17:09:23 1.341
+++ src/sys/arch/amd64/amd64/machdep.c 2019/12/06 08:35:21 1.342
@@ -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 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);

cvs diff -r1.2 -r1.3 src/sys/compat/common/compat_sysctl_09_43.c (expand / switch to context diff)
--- src/sys/compat/common/compat_sysctl_09_43.c 2019/01/27 02:08:39 1.2
+++ src/sys/compat/common/compat_sysctl_09_43.c 2019/12/06 08:35:21 1.3
@@ -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 @@
 }
 #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;
 }
 

cvs diff -r1.41 -r1.42 src/sys/kern/tty_subr.c (expand / switch to context diff)
--- src/sys/kern/tty_subr.c 2017/06/01 02:45:13 1.41
+++ src/sys/kern/tty_subr.c 2019/12/06 08:35:21 1.42
@@ -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 @@
 	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 @@
 		/*
 		 * 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 @@
 {
 	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;