Module Name:    src
Committed By:   joe
Date:           Thu Feb 13 23:52:28 UTC 2025

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

Log Message:
use the right buffer size for shared pin check and debug

avoid the use of sizeof(pointer) and use the Temp BUF limit


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/pci/if_gem_pci.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_gem_pci.c
diff -u src/sys/dev/pci/if_gem_pci.c:1.53 src/sys/dev/pci/if_gem_pci.c:1.54
--- src/sys/dev/pci/if_gem_pci.c:1.53	Thu Feb 13 16:07:40 2025
+++ src/sys/dev/pci/if_gem_pci.c	Thu Feb 13 23:52:28 2025
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_gem_pci.c,v 1.53 2025/02/13 16:07:40 joe Exp $ */
+/*	$NetBSD: if_gem_pci.c,v 1.54 2025/02/13 23:52:28 joe Exp $ */
 
 /*
  *
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_gem_pci.c,v 1.53 2025/02/13 16:07:40 joe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gem_pci.c,v 1.54 2025/02/13 23:52:28 joe Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -268,7 +268,7 @@ gem_pci_attach(device_t parent, device_t
 			/* Check for "shared-pins = serdes" in FCode. */
 			i = 0;
 			serdes = 0;
-			while (i < (sizeof buf) - sizeof "serdes") {
+			while (i < GEM_TMP_BUFSIZE - sizeof "serdes") {
 				if (!serdes) {
 					if (isserdes(&buf[i]))
 						serdes = 1;
@@ -285,11 +285,11 @@ gem_pci_attach(device_t parent, device_t
 #ifdef GEM_DEBUG
 			/* PROM dump */
 			printf("%s: PROM dump (0x0000 to %04zx)\n",
-			    device_xname(sc->sc_dev), (sizeof buf) - 1);
+			    device_xname(sc->sc_dev), GEM_TMP_BUFSIZE - 1);
 			i = 0;
 			j = 0;
 			printf("  %04x  ", i);
-			while (i < sizeof buf) {
+			while (i < GEM_TMP_BUFSIZE ) {
 				printf("%02x ", buf[i]);
 				if (i && !(i % 8))
 					printf(" ");

Reply via email to