Module Name:    src
Committed By:   skrll
Date:           Sat Jul  2 08:31:43 UTC 2022

Modified Files:
        src/sys/dev/pci: if_bge.c

Log Message:
Modernise bge_update_all_threshes.  Same code before and after.


To generate a diff of this commit:
cvs rdiff -u -r1.359 -r1.360 src/sys/dev/pci/if_bge.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/dev/pci/if_bge.c
diff -u src/sys/dev/pci/if_bge.c:1.359 src/sys/dev/pci/if_bge.c:1.360
--- src/sys/dev/pci/if_bge.c:1.359	Sat Jul  2 07:32:16 2022
+++ src/sys/dev/pci/if_bge.c	Sat Jul  2 08:31:43 2022
@@ -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 @@ bge_set_thresh(struct ifnet *ifp, int lv
 static void
 bge_update_all_threshes(int lvl)
 {
-	struct ifnet *ifp;
 	const char * const namebuf = "bge";
-	int namelen;
-	int s;
+	const size_t namelen = strlen(namebuf);
+	struct ifnet *ifp;
 
 	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;

Reply via email to