Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Modernise bge_update_all_threshes. Same code be...



details:   https://anonhg.NetBSD.org/src/rev/ce62e54d6609
branches:  trunk
changeset: 368271:ce62e54d6609
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sat Jul 02 08:31:43 2022 +0000

description:
Modernise bge_update_all_threshes.  Same code before and after.

diffstat:

 sys/dev/pci/if_bge.c |  12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diffs (43 lines):

diff -r dd6ae7adc077 -r ce62e54d6609 sys/dev/pci/if_bge.c
--- a/sys/dev/pci/if_bge.c      Sat Jul 02 08:25:21 2022 +0000
+++ b/sys/dev/pci/if_bge.c      Sat Jul 02 08:31:43 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bge.c,v 1.359 2022/07/02 07:32:16 skrll Exp $       */
+/*     $NetBSD: if_bge.c,v 1.360 2022/07/02 08:31:43 skrll Exp $       */
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.359 2022/07/02 07:32:16 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.360 2022/07/02 08:31:43 skrll Exp $");
 
 #include <sys/param.h>
 
@@ -1276,21 +1276,19 @@
 static void
 bge_update_all_threshes(int lvl)
 {
+       const char * const namebuf = "bge";
+       const size_t namelen = strlen(namebuf);
        struct ifnet *ifp;
-       const char * const namebuf = "bge";
-       int namelen;
-       int s;
 
        if (lvl < 0)
                lvl = 0;
        else if (lvl >= NBGE_RX_THRESH)
                lvl = NBGE_RX_THRESH - 1;
 
-       namelen = strlen(namebuf);
        /*
         * Now search all the interfaces for this name/number
         */
-       s = pserialize_read_enter();
+       int s = pserialize_read_enter();
        IFNET_READER_FOREACH(ifp) {
                if (strncmp(ifp->if_xname, namebuf, namelen) != 0)
                      continue;



Home | Main Index | Thread Index | Old Index