Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Fix a bunch of unimportant "Local variable hides global ...



details:   https://anonhg.NetBSD.org/src/rev/950873d981f4
branches:  trunk
changeset: 846982:950873d981f4
user:      maxv <maxv%NetBSD.org@localhost>
date:      Fri Dec 06 08:35:21 2019 +0000

description:
Fix a bunch of unimportant "Local variable hides global variable" warnings
from the LGTM bot.

diffstat:

 sys/arch/amd64/amd64/machdep.c          |  20 ++++++++++----------
 sys/compat/common/compat_sysctl_09_43.c |  10 +++++-----
 sys/kern/tty_subr.c                     |  16 ++++++++--------
 3 files changed, 23 insertions(+), 23 deletions(-)

diffs (147 lines):

diff -r b9abc5df40f1 -r 950873d981f4 sys/arch/amd64/amd64/machdep.c
--- a/sys/arch/amd64/amd64/machdep.c    Fri Dec 06 07:27:06 2019 +0000
+++ b/sys/arch/amd64/amd64/machdep.c    Fri Dec 06 08:35:21 2019 +0000
@@ -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);
diff -r b9abc5df40f1 -r 950873d981f4 sys/compat/common/compat_sysctl_09_43.c
--- a/sys/compat/common/compat_sysctl_09_43.c   Fri Dec 06 07:27:06 2019 +0000
+++ b/sys/compat/common/compat_sysctl_09_43.c   Fri Dec 06 08:35:21 2019 +0000
@@ -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;
 }
 
diff -r b9abc5df40f1 -r 950873d981f4 sys/kern/tty_subr.c
--- a/sys/kern/tty_subr.c       Fri Dec 06 07:27:06 2019 +0000
+++ b/sys/kern/tty_subr.c       Fri Dec 06 08:35:21 2019 +0000
@@ -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;



Home | Main Index | Thread Index | Old Index