Module Name:    src
Committed By:   ryo
Date:           Mon Oct 25 07:45:01 UTC 2021

Modified Files:
        src/sys/dev/ic: aic79xx.c aic7xxx.c

Log Message:
fix "error: stack usage might be unbounded [-Werror=stack-usage=]" with 
COPTS=-O0


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/ic/aic79xx.c
cvs rdiff -u -r1.144 -r1.145 src/sys/dev/ic/aic7xxx.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/ic/aic79xx.c
diff -u src/sys/dev/ic/aic79xx.c:1.58 src/sys/dev/ic/aic79xx.c:1.59
--- src/sys/dev/ic/aic79xx.c:1.58	Thu Sep 16 22:19:10 2021
+++ src/sys/dev/ic/aic79xx.c	Mon Oct 25 07:45:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: aic79xx.c,v 1.58 2021/09/16 22:19:10 andvar Exp $	*/
+/*	$NetBSD: aic79xx.c,v 1.59 2021/10/25 07:45:01 ryo Exp $	*/
 
 /*
  * Core routines and tables shareable across OS platforms.
@@ -49,7 +49,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aic79xx.c,v 1.58 2021/09/16 22:19:10 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aic79xx.c,v 1.59 2021/10/25 07:45:01 ryo Exp $");
 
 #include <dev/ic/aic79xx_osm.h>
 #include <dev/ic/aic79xx_inline.h>
@@ -8255,9 +8255,9 @@ ahd_dumpseq(struct ahd_softc* ahd)
 static void __noinline
 ahd_loadseq(struct ahd_softc *ahd)
 {
-	struct	cs cs_table[num_critical_sections];
-	u_int	begin_set[num_critical_sections];
-	u_int	end_set[num_critical_sections];
+	struct	cs cs_table[NUM_CRITICAL_SECTIONS];
+	u_int	begin_set[NUM_CRITICAL_SECTIONS];
+	u_int	end_set[NUM_CRITICAL_SECTIONS];
 	const struct patch *cur_patch;
 	u_int	cs_count;
 	u_int	cur_cs;

Index: src/sys/dev/ic/aic7xxx.c
diff -u src/sys/dev/ic/aic7xxx.c:1.144 src/sys/dev/ic/aic7xxx.c:1.145
--- src/sys/dev/ic/aic7xxx.c:1.144	Thu Sep 16 22:19:11 2021
+++ src/sys/dev/ic/aic7xxx.c	Mon Oct 25 07:45:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: aic7xxx.c,v 1.144 2021/09/16 22:19:11 andvar Exp $	*/
+/*	$NetBSD: aic7xxx.c,v 1.145 2021/10/25 07:45:01 ryo Exp $	*/
 
 /*
  * Core routines and tables shareable across OS platforms.
@@ -39,7 +39,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: aic7xxx.c,v 1.144 2021/09/16 22:19:11 andvar Exp $
+ * $Id: aic7xxx.c,v 1.145 2021/10/25 07:45:01 ryo Exp $
  *
  * //depot/aic7xxx/aic7xxx/aic7xxx.c#112 $
  *
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aic7xxx.c,v 1.144 2021/09/16 22:19:11 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aic7xxx.c,v 1.145 2021/10/25 07:45:01 ryo Exp $");
 
 #include <dev/ic/aic7xxx_osm.h>
 #include <dev/ic/aic7xxx_inline.h>
@@ -6278,9 +6278,9 @@ ahc_dumpseq(struct ahc_softc* ahc)
 static void __noinline
 ahc_loadseq(struct ahc_softc *ahc)
 {
-	struct	cs cs_table[num_critical_sections];
-	u_int	begin_set[num_critical_sections];
-	u_int	end_set[num_critical_sections];
+	struct	cs cs_table[NUM_CRITICAL_SECTIONS];
+	u_int	begin_set[NUM_CRITICAL_SECTIONS];
+	u_int	end_set[NUM_CRITICAL_SECTIONS];
 	const struct	patch *cur_patch;
 	u_int	cs_count;
 	u_int	cur_cs;
@@ -6332,7 +6332,7 @@ ahc_loadseq(struct ahc_softc *ahc)
 		 * Move through the CS table until we find a CS
 		 * that might apply to this instruction.
 		 */
-		for (; cur_cs < num_critical_sections; cur_cs++) {
+		for (; cur_cs < NUM_CRITICAL_SECTIONS; cur_cs++) {
 			if (critical_sections[cur_cs].end <= i) {
 				if (begin_set[cs_count] == TRUE
 				 && end_set[cs_count] == FALSE) {

Reply via email to