From 590ed564a86b49eb1d9625c8678d4907db3ceed3 Mon Sep 17 00:00:00 2001 From: tsutsui Date: Sun, 2 Mar 2008 06:17:41 +0000 Subject: [PATCH] WARNSfy --- sys/arch/cobalt/stand/boot/Makefile | 6 +++++- sys/arch/cobalt/stand/boot/boot.c | 4 +++- sys/arch/cobalt/stand/boot/com.c | 4 +++- sys/arch/cobalt/stand/boot/devopen.c | 3 ++- sys/arch/cobalt/stand/boot/prf.c | 3 ++- sys/arch/cobalt/stand/boot/wd.c | 7 +++++-- sys/arch/cobalt/stand/boot/wdc.c | 6 ++---- 7 files changed, 22 insertions(+), 11 deletions(-) diff --git a/sys/arch/cobalt/stand/boot/Makefile b/sys/arch/cobalt/stand/boot/Makefile index 1f7df5b0424c..12bb2d547dd5 100644 --- a/sys/arch/cobalt/stand/boot/Makefile +++ b/sys/arch/cobalt/stand/boot/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.14 2008/03/01 18:13:02 tsutsui Exp $ +# $NetBSD: Makefile,v 1.15 2008/03/02 06:17:41 tsutsui Exp $ NOMAN= # defined @@ -63,6 +63,10 @@ CPPFLAGS+= -DSUPPORT_DHCP -DSUPPORT_BOOTP # compiler flags for smallest code size CFLAGS= -Os -mmemcpy -ffreestanding -mno-abicalls -msoft-float -G 128 +CFLAGS+= -Wall -Werror +CFLAGS+= -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith +CFLAGS+= -Wno-pointer-sign + NETBSD_VERS!= ${HOST_SH} ${S}/conf/osrelease.sh CPPFLAGS+= -DNETBSD_VERS='"${NETBSD_VERS}"' diff --git a/sys/arch/cobalt/stand/boot/boot.c b/sys/arch/cobalt/stand/boot/boot.c index e394f5ddbfd2..7dff5f921131 100644 --- a/sys/arch/cobalt/stand/boot/boot.c +++ b/sys/arch/cobalt/stand/boot/boot.c @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.12 2008/03/01 18:13:02 tsutsui Exp $ */ +/* $NetBSD: boot.c,v 1.13 2008/03/02 06:17:41 tsutsui Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -429,6 +429,8 @@ main(unsigned int memsize) try_bootp = 1; /* Initialize boot info early */ + dev = NULL; + kernel = NULL; howto = 0x0; bi_flags.bi_flags = 0x0; bi_addr = bi_init(); diff --git a/sys/arch/cobalt/stand/boot/com.c b/sys/arch/cobalt/stand/boot/com.c index 9d3cd1df03bc..8b6637787416 100644 --- a/sys/arch/cobalt/stand/boot/com.c +++ b/sys/arch/cobalt/stand/boot/com.c @@ -1,4 +1,4 @@ -/* $NetBSD: com.c,v 1.6 2007/10/17 19:54:09 garbled Exp $ */ +/* $NetBSD: com.c,v 1.7 2008/03/02 06:17:41 tsutsui Exp $ */ /*- * Copyright (c) 1993, 1994, 1995, 1996, 1997 @@ -65,6 +65,8 @@ */ #include +#include +#include "boot.h" #define COM_FREQ 1843200 /* 16-bit baud rate divisor */ #define COM_TOLERANCE 30 /* baud rate tolerance, in 0.1% units */ diff --git a/sys/arch/cobalt/stand/boot/devopen.c b/sys/arch/cobalt/stand/boot/devopen.c index 76feb652f191..db9d65749779 100644 --- a/sys/arch/cobalt/stand/boot/devopen.c +++ b/sys/arch/cobalt/stand/boot/devopen.c @@ -1,4 +1,4 @@ -/* $NetBSD: devopen.c,v 1.4 2007/10/30 15:07:08 tsutsui Exp $ */ +/* $NetBSD: devopen.c,v 1.5 2008/03/02 06:17:41 tsutsui Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -96,6 +96,7 @@ devparse(const char *fname, int *dev, uint8_t *unit, uint8_t *part, return EPART; /* partition number */ + p = 0; if (i < devlen) p = fname[i++] - 'a'; diff --git a/sys/arch/cobalt/stand/boot/prf.c b/sys/arch/cobalt/stand/boot/prf.c index 45d09923e0e2..4d2b282dfdcc 100644 --- a/sys/arch/cobalt/stand/boot/prf.c +++ b/sys/arch/cobalt/stand/boot/prf.c @@ -1,4 +1,4 @@ -/* $NetBSD: prf.c,v 1.3 2007/10/17 19:54:09 garbled Exp $ */ +/* $NetBSD: prf.c,v 1.4 2008/03/02 06:17:41 tsutsui Exp $ */ /*- * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. @@ -37,6 +37,7 @@ */ #include +#include "boot.h" void putchar(int c) diff --git a/sys/arch/cobalt/stand/boot/wd.c b/sys/arch/cobalt/stand/boot/wd.c index 89f721e53c90..29933ed8936a 100644 --- a/sys/arch/cobalt/stand/boot/wd.c +++ b/sys/arch/cobalt/stand/boot/wd.c @@ -1,4 +1,4 @@ -/* $NetBSD: wd.c,v 1.8 2007/10/17 19:54:09 garbled Exp $ */ +/* $NetBSD: wd.c,v 1.9 2008/03/02 06:17:41 tsutsui Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -243,12 +244,13 @@ wdclose(struct open_file *f) * Read some data. */ int -wdstrategy(void *f, int rw, daddr_t dblk, size_t size, void *buf, size_t *rsize) +wdstrategy(void *f, int rw, daddr_t dblk, size_t size, void *p, size_t *rsize) { int i, nsect; daddr_t blkno; struct wd_softc *wd; struct partition *pp; + uint8_t *buf; if (size == 0) return 0; @@ -256,6 +258,7 @@ wdstrategy(void *f, int rw, daddr_t dblk, size_t size, void *buf, size_t *rsize) if (rw != F_READ) return EOPNOTSUPP; + buf = p; wd = f; pp = &wd->sc_label.d_partitions[wd->sc_part]; diff --git a/sys/arch/cobalt/stand/boot/wdc.c b/sys/arch/cobalt/stand/boot/wdc.c index 92ba505e0193..76b73b383b0b 100644 --- a/sys/arch/cobalt/stand/boot/wdc.c +++ b/sys/arch/cobalt/stand/boot/wdc.c @@ -1,4 +1,4 @@ -/* $NetBSD: wdc.c,v 1.9 2007/10/17 19:54:10 garbled Exp $ */ +/* $NetBSD: wdc.c,v 1.10 2008/03/02 06:17:41 tsutsui Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -118,7 +118,7 @@ __wdcwait_reset(struct wdc_channel *chp, int drv_mask) static int wdcprobe(struct wdc_channel *chp) { - uint8_t st0, st1, sc, sn, cl, ch; + uint8_t st0, st1; uint8_t ret_value = 0x03; uint8_t drive; int found; @@ -227,7 +227,6 @@ wdc_read_block(struct wd_softc *sc, struct wdc_command *wd_c) int wdccommand(struct wd_softc *sc, struct wdc_command *wd_c) { - uint8_t err; struct wdc_channel *chp = &sc->sc_channel; #if 0 @@ -264,7 +263,6 @@ wdccommand(struct wd_softc *sc, struct wdc_command *wd_c) int wdccommandext(struct wd_softc *wd, struct wdc_command *wd_c) { - uint8_t err; struct wdc_channel *chp = &wd->sc_channel; /* Select drive, head, and addressing mode. */