Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic fix "error: stack usage might be unbounded [-Werr...



details:   https://anonhg.NetBSD.org/src/rev/f568f22a497e
branches:  trunk
changeset: 990062:f568f22a497e
user:      ryo <ryo%NetBSD.org@localhost>
date:      Mon Oct 25 07:45:01 2021 +0000

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

diffstat:

 sys/dev/ic/aic79xx.c |  10 +++++-----
 sys/dev/ic/aic7xxx.c |  14 +++++++-------
 2 files changed, 12 insertions(+), 12 deletions(-)

diffs (80 lines):

diff -r e2f5781a0166 -r f568f22a497e sys/dev/ic/aic79xx.c
--- a/sys/dev/ic/aic79xx.c      Mon Oct 25 07:43:48 2021 +0000
+++ b/sys/dev/ic/aic79xx.c      Mon Oct 25 07:45:01 2021 +0000
@@ -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 @@
 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;
diff -r e2f5781a0166 -r f568f22a497e sys/dev/ic/aic7xxx.c
--- a/sys/dev/ic/aic7xxx.c      Mon Oct 25 07:43:48 2021 +0000
+++ b/sys/dev/ic/aic7xxx.c      Mon Oct 25 07:45:01 2021 +0000
@@ -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 @@
 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 @@
                 * 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) {



Home | Main Index | Thread Index | Old Index