Module Name:    src
Committed By:   mrg
Date:           Thu Mar  8 03:12:02 UTC 2018

Modified Files:
        src/sys/arch/hp300/stand/common: devopen.c
        src/sys/arch/luna68k/dev: lcd.c
        src/sys/arch/mvme68k/conf: Makefile.mvme68k
        src/sys/arch/mvme68k/dev: sbic.c
        src/sys/arch/mvme68k/stand/sboot: le_poll.c
        src/sys/arch/next68k/next68k: nextrom.c
        src/sys/arch/next68k/stand/boot: en.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/hp300/stand/common/devopen.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/luna68k/dev/lcd.c
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/mvme68k/conf/Makefile.mvme68k
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/mvme68k/dev/sbic.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/mvme68k/stand/sboot/le_poll.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/next68k/next68k/nextrom.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/next68k/stand/boot/en.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/arch/hp300/stand/common/devopen.c
diff -u src/sys/arch/hp300/stand/common/devopen.c:1.11 src/sys/arch/hp300/stand/common/devopen.c:1.12
--- src/sys/arch/hp300/stand/common/devopen.c:1.11	Sun Aug 10 07:40:49 2014
+++ src/sys/arch/hp300/stand/common/devopen.c	Thu Mar  8 03:12:01 2018
@@ -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 @@ devparse(const char *fname, int *dev, in
 
 	/* get device name */
 	for (s = (char *)fname; *s && *s != '/' && *s != ':' && *s != '('; s++)
-		;
+		continue;
 
 	/* first form */
 	if (*s == '(') {
@@ -188,11 +188,12 @@ devparse(const char *fname, int *dev, in
 		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 @@ devparse(const char *fname, int *dev, in
 		*adapt = temp / 8;
 		*ctlr = temp % 8;
 		for (; isdigit(*s); s++)
-			;
+			continue;
 	
 		/* translate partition */
 		if (!ispart(*s))

Index: src/sys/arch/luna68k/dev/lcd.c
diff -u src/sys/arch/luna68k/dev/lcd.c:1.8 src/sys/arch/luna68k/dev/lcd.c:1.9
--- src/sys/arch/luna68k/dev/lcd.c:1.8	Thu Mar  9 14:05:58 2017
+++ src/sys/arch/luna68k/dev/lcd.c	Thu Mar  8 03:12:02 2018
@@ -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 @@ lcdioctl(dev_t dev, u_long cmd, void *ad
 	case LCDMOVE:
 	case LCDSEEK:
 	case LCDRESTORE:
-	if ((flag & FWRITE) == 0)
-		return EACCES;
-		break;
+		if ((flag & FWRITE) == 0)
+			return EACCES;
 	}
 
 	switch (cmd) {

Index: src/sys/arch/mvme68k/conf/Makefile.mvme68k
diff -u src/sys/arch/mvme68k/conf/Makefile.mvme68k:1.66 src/sys/arch/mvme68k/conf/Makefile.mvme68k:1.67
--- src/sys/arch/mvme68k/conf/Makefile.mvme68k:1.66	Sun Sep  6 02:17:31 2015
+++ src/sys/arch/mvme68k/conf/Makefile.mvme68k	Thu Mar  8 03:12:02 2018
@@ -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 @@ CMACHFLAGS=	-m68030
 .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

Index: src/sys/arch/mvme68k/dev/sbic.c
diff -u src/sys/arch/mvme68k/dev/sbic.c:1.34 src/sys/arch/mvme68k/dev/sbic.c:1.35
--- src/sys/arch/mvme68k/dev/sbic.c:1.34	Mon Mar 24 19:52:27 2014
+++ src/sys/arch/mvme68k/dev/sbic.c	Thu Mar  8 03:12:02 2018
@@ -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 @@ sbicintr(struct sbic_softc *dev)
 		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);

Index: src/sys/arch/mvme68k/stand/sboot/le_poll.c
diff -u src/sys/arch/mvme68k/stand/sboot/le_poll.c:1.5 src/sys/arch/mvme68k/stand/sboot/le_poll.c:1.6
--- src/sys/arch/mvme68k/stand/sboot/le_poll.c:1.5	Sat Jan 12 09:54:33 2008
+++ src/sys/arch/mvme68k/stand/sboot/le_poll.c	Thu Mar  8 03:12:02 2018
@@ -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 @@ int le_put(u_char *pkt, size_t len)
 	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 @@ int le_put(u_char *pkt, size_t len)
 #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;

Index: src/sys/arch/next68k/next68k/nextrom.c
diff -u src/sys/arch/next68k/next68k/nextrom.c:1.25 src/sys/arch/next68k/next68k/nextrom.c:1.26
--- src/sys/arch/next68k/next68k/nextrom.c:1.25	Sat Aug 11 01:21:04 2012
+++ src/sys/arch/next68k/next68k/nextrom.c	Thu Mar  8 03:12:02 2018
@@ -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 @@ next68k_bootargs(unsigned char **args)
 	 */
 
 	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++) {

Index: src/sys/arch/next68k/stand/boot/en.c
diff -u src/sys/arch/next68k/stand/boot/en.c:1.18 src/sys/arch/next68k/stand/boot/en.c:1.19
--- src/sys/arch/next68k/stand/boot/en.c:1.18	Fri Jan 23 03:36:58 2015
+++ src/sys/arch/next68k/stand/boot/en.c	Thu Mar  8 03:12:02 2018
@@ -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 @@ en_put(struct iodesc *desc, void *pkt, s
 #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;

Reply via email to