Source-Changes-HG archive

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

[src/trunk]: src/sys/arch fix various gcc6 m68k issues:



details:   https://anonhg.NetBSD.org/src/rev/74335caab061
branches:  trunk
changeset: 321256:74335caab061
user:      mrg <mrg%NetBSD.org@localhost>
date:      Thu Mar 08 03:12:01 2018 +0000

description:
fix various gcc6 m68k issues:
- bad indentation.  next68k en.c and mvme68k le_poll.c fixes real issues
  in error handling, the rest are NFCI.
- pass 68030 flags as appropriate for mvme68k.
- next68k nextrom.c has -Warray-bounds ignored for an odd expression
  that appears to run before relocation, and needs manual offsets
  added which trips bounds array checking.

with this all m68k ports build with GCC 6.

diffstat:

 sys/arch/hp300/stand/common/devopen.c  |  15 ++++++++-------
 sys/arch/luna68k/dev/lcd.c             |   9 ++++-----
 sys/arch/mvme68k/conf/Makefile.mvme68k |   6 +++---
 sys/arch/mvme68k/dev/sbic.c            |   8 ++++----
 sys/arch/mvme68k/stand/sboot/le_poll.c |   6 +++---
 sys/arch/next68k/next68k/nextrom.c     |   7 +++++--
 sys/arch/next68k/stand/boot/en.c       |   5 +++--
 7 files changed, 30 insertions(+), 26 deletions(-)

diffs (201 lines):

diff -r 9119b49761a0 -r 74335caab061 sys/arch/hp300/stand/common/devopen.c
--- a/sys/arch/hp300/stand/common/devopen.c     Thu Mar 08 02:41:27 2018 +0000
+++ b/sys/arch/hp300/stand/common/devopen.c     Thu Mar 08 03:12:01 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: devopen.c,v 1.11 2014/08/10 07:40:49 isaki Exp $       */
+/*     $NetBSD: devopen.c,v 1.12 2018/03/08 03:12:01 mrg Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -144,7 +144,7 @@
 
        /* get device name */
        for (s = (char *)fname; *s && *s != '/' && *s != ':' && *s != '('; s++)
-               ;
+               continue;
 
        /* first form */
        if (*s == '(') {
@@ -188,11 +188,12 @@
                int temp;
 
                /* isolate device */
-               for (s = (char *)fname; *s != ':' && !isdigit(*s); s++);
+               for (s = (char *)fname; *s != ':' && !isdigit(*s); s++)
+                       continue;
        
-                       /* lookup device and get index */
-                       if ((*dev = devlookup(fname, s - fname)) < 0)
-                               goto baddev;
+               /* lookup device and get index */
+               if ((*dev = devlookup(fname, s - fname)) < 0)
+                       goto baddev;
 
                /* isolate unit */
                if ((temp = atoi(s)) > 255)
@@ -200,7 +201,7 @@
                *adapt = temp / 8;
                *ctlr = temp % 8;
                for (; isdigit(*s); s++)
-                       ;
+                       continue;
        
                /* translate partition */
                if (!ispart(*s))
diff -r 9119b49761a0 -r 74335caab061 sys/arch/luna68k/dev/lcd.c
--- a/sys/arch/luna68k/dev/lcd.c        Thu Mar 08 02:41:27 2018 +0000
+++ b/sys/arch/luna68k/dev/lcd.c        Thu Mar 08 03:12:01 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lcd.c,v 1.8 2017/03/09 14:05:58 tsutsui Exp $ */
+/* $NetBSD: lcd.c,v 1.9 2018/03/08 03:12:02 mrg Exp $ */
 /* $OpenBSD: lcd.c,v 1.7 2015/02/10 22:42:35 miod Exp $ */
 
 /*-
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>         /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: lcd.c,v 1.8 2017/03/09 14:05:58 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lcd.c,v 1.9 2018/03/08 03:12:02 mrg Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -214,9 +214,8 @@
        case LCDMOVE:
        case LCDSEEK:
        case LCDRESTORE:
-       if ((flag & FWRITE) == 0)
-               return EACCES;
-               break;
+               if ((flag & FWRITE) == 0)
+                       return EACCES;
        }
 
        switch (cmd) {
diff -r 9119b49761a0 -r 74335caab061 sys/arch/mvme68k/conf/Makefile.mvme68k
--- a/sys/arch/mvme68k/conf/Makefile.mvme68k    Thu Mar 08 02:41:27 2018 +0000
+++ b/sys/arch/mvme68k/conf/Makefile.mvme68k    Thu Mar 08 03:12:01 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.mvme68k,v 1.66 2015/09/06 02:17:31 uebayasi Exp $
+#      $NetBSD: Makefile.mvme68k,v 1.67 2018/03/08 03:12:02 mrg Exp $
 
 # Makefile for NetBSD
 #
@@ -40,9 +40,9 @@
 .endif
 .else
 .if empty(IDENT:M-DMVME147) && empty(IDENT:M-DMVME162) && empty(IDENT:M-DMVME167)
-CMACHFLAGS=    -m68060 -Wa,-march=68030 -Wa,-mcpu=68030 -Wa,-m68851
+CMACHFLAGS=    -m68060 -Wa,-march=68030 -Wa,-m68030 -Wa,-mcpu=68030 -Wa,-m68851
 .else
-CMACHFLAGS=    -m68020-60 -Wa,-mcpu=68030 -Wa,-m68851
+CMACHFLAGS=    -m68020-60 -Wa,-m68030 -Wa,-mcpu=68030 -Wa,-m68851
 .endif
 .endif
 CFLAGS+=       ${CMACHFLAGS} -msoft-float
diff -r 9119b49761a0 -r 74335caab061 sys/arch/mvme68k/dev/sbic.c
--- a/sys/arch/mvme68k/dev/sbic.c       Thu Mar 08 02:41:27 2018 +0000
+++ b/sys/arch/mvme68k/dev/sbic.c       Thu Mar 08 03:12:01 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sbic.c,v 1.34 2014/03/24 19:52:27 christos Exp $       */
+/*     $NetBSD: sbic.c,v 1.35 2018/03/08 03:12:02 mrg Exp $    */
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -86,7 +86,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sbic.c,v 1.34 2014/03/24 19:52:27 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbic.c,v 1.35 2018/03/08 03:12:02 mrg Exp $");
 
 #include "opt_ddb.h"
 
@@ -1682,8 +1682,8 @@
                if (i == SBIC_STATE_RUNNING) {
                        GET_SBIC_asr(regs, asr);
 
-               if (asr & SBIC_ASR_LCI)
-                       printf("sbicgo: LCI asr:%02x csr:%02x\n", asr, csr);
+                       if (asr & SBIC_ASR_LCI)
+                               printf("sbicgo: LCI asr:%02x csr:%02x\n", asr, csr);
 
                        if (asr & SBIC_ASR_INT)
                                GET_SBIC_csr(regs, csr);
diff -r 9119b49761a0 -r 74335caab061 sys/arch/mvme68k/stand/sboot/le_poll.c
--- a/sys/arch/mvme68k/stand/sboot/le_poll.c    Thu Mar 08 02:41:27 2018 +0000
+++ b/sys/arch/mvme68k/stand/sboot/le_poll.c    Thu Mar 08 03:12:01 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: le_poll.c,v 1.5 2008/01/12 09:54:33 tsutsui Exp $      */
+/*     $NetBSD: le_poll.c,v 1.6 2018/03/08 03:12:02 mrg Exp $  */
 
 /*
  * Copyright (c) 1993 Adam Glass
@@ -239,7 +239,7 @@
        if (ler1->ler1_rdp & LE_C0_ERR) {
                if ((ler1->ler1_rdp &
                    (LE_C0_BABL|LE_C0_CERR|LE_C0_MISS|LE_C0_MERR)) !=
-                   LE_C0_CERR)
+                   LE_C0_CERR) {
                        printf("le_put: xmit error, buf %d\n",
                            le_softc.next_tmd);
                        le_error("le_put(xmit error)", ler1);
@@ -248,7 +248,7 @@
 #if 0
                (le_softc.next_tmd == (LETBUF - 1)) ? 0 : le_softc.next_tmd + 1;
 #endif
-               if (tmd->tmd1_bits & LE_T1_ERR) {
+               if (tmd->tmd1_bits & LE_T1_ERR)
                        printf("le0: transmit error, error = 0x%x\n",
                            tmd->tmd3);
                return -1;
diff -r 9119b49761a0 -r 74335caab061 sys/arch/next68k/next68k/nextrom.c
--- a/sys/arch/next68k/next68k/nextrom.c        Thu Mar 08 02:41:27 2018 +0000
+++ b/sys/arch/next68k/next68k/nextrom.c        Thu Mar 08 03:12:01 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nextrom.c,v 1.25 2012/08/11 01:21:04 tsutsui Exp $     */
+/*     $NetBSD: nextrom.c,v 1.26 2018/03/08 03:12:02 mrg Exp $ */
 /*
  * Copyright (c) 1998 Darrin B. Jewell
  * All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nextrom.c,v 1.25 2012/08/11 01:21:04 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nextrom.c,v 1.26 2018/03/08 03:12:02 mrg Exp $");
 
 #include "opt_ddb.h"
 #include "opt_serial.h"
@@ -155,7 +155,10 @@
         */
 
        reloc_end = end + NEXT_RAMBASE;
+#pragma GCC push_options
+#pragma GCC diagnostic ignored "-Warray-bounds"
        reloc_elfmag = ELFMAG + NEXT_RAMBASE;
+#pragma GCC pop_options
        ehdr = (void *)reloc_end;
 
        for (i = 0; i < SELFMAG; i++) {
diff -r 9119b49761a0 -r 74335caab061 sys/arch/next68k/stand/boot/en.c
--- a/sys/arch/next68k/stand/boot/en.c  Thu Mar 08 02:41:27 2018 +0000
+++ b/sys/arch/next68k/stand/boot/en.c  Thu Mar 08 03:12:01 2018 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: en.c,v 1.18 2015/01/23 03:36:58 chs Exp $        */
+/*      $NetBSD: en.c,v 1.19 2018/03/08 03:12:02 mrg Exp $        */
 /*
  * Copyright (c) 1996 Rolf Grossmann
  * All rights reserved.
@@ -247,9 +247,10 @@
 #if 01
                        DPRINTF(("en_put: DMA state = 0x%x.\n", state));
 #endif
-                       if (state & (DMACSR_COMPLETE|DMACSR_BUSEXC))
+                       if (state & (DMACSR_COMPLETE|DMACSR_BUSEXC)) {
                                txdma->dd_csr = DMACSR_RESET | DMACSR_CLRCOMPLETE;
                                break;
+                       }
                }
 
                txs = er->txstat;



Home | Main Index | Thread Index | Old Index