Source-Changes-HG archive

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

[src/trunk]: src/sys/miscfs/procfs use a single nc variable.



details:   https://anonhg.NetBSD.org/src/rev/b0c07a369ce9
branches:  trunk
changeset: 359582:b0c07a369ce9
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Jan 10 23:16:05 2022 +0000

description:
use a single nc variable.

diffstat:

 sys/miscfs/procfs/procfs_vnops.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (51 lines):

diff -r 5020428dda1b -r b0c07a369ce9 sys/miscfs/procfs/procfs_vnops.c
--- a/sys/miscfs/procfs/procfs_vnops.c  Mon Jan 10 22:26:14 2022 +0000
+++ b/sys/miscfs/procfs/procfs_vnops.c  Mon Jan 10 23:16:05 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: procfs_vnops.c,v 1.221 2022/01/10 22:26:14 christos Exp $      */
+/*     $NetBSD: procfs_vnops.c,v 1.222 2022/01/10 23:16:05 christos Exp $      */
 
 /*-
  * Copyright (c) 2006, 2007, 2008, 2020 The NetBSD Foundation, Inc.
@@ -105,7 +105,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_vnops.c,v 1.221 2022/01/10 22:26:14 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_vnops.c,v 1.222 2022/01/10 23:16:05 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -1289,6 +1289,7 @@
        struct procfs_root_readdir_ctx ctx;
        struct lwp *l;
        int nfd;
+       int nc = 0;
 
        vp = ap->a_vp;
        pfs = VTOPFS(vp);
@@ -1356,7 +1357,7 @@
        case PFSfd: {
                struct proc *p;
                file_t *fp;
-               int lim, nc = 0;
+               int lim;
 
                if ((error = procfs_proc_lock(vp->v_mount, pfs->pfs_pid, &p,
                                              ESRCH)) != 0)
@@ -1421,7 +1422,6 @@
        }
        case PFStask: {
                struct proc *p;
-               int nc = 0;
 
                if ((error = procfs_proc_lock(vp->v_mount, pfs->pfs_pid, &p,
                                              ESRCH)) != 0)
@@ -1476,7 +1476,6 @@
 
        case PFSroot: {
                struct proc *p;
-               int nc = 0;
 
                if (ap->a_ncookies) {
                        /*



Home | Main Index | Thread Index | Old Index