diff --git a/sys/arch/amiga/amiga/machdep.c b/sys/arch/amiga/amiga/machdep.c index 035079867c45..e859ec850a9a 100644 --- a/sys/arch/amiga/amiga/machdep.c +++ b/sys/arch/amiga/amiga/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.241 2013/01/28 16:36:10 rkujawa Exp $ */ +/* $NetBSD: machdep.c,v 1.242 2014/03/22 01:52:44 christos Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -50,7 +50,7 @@ #include "empm.h" #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.241 2013/01/28 16:36:10 rkujawa Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.242 2014/03/22 01:52:44 christos Exp $"); #include #include @@ -308,7 +308,7 @@ identifycpu(void) char machbuf[16]; if (is_draco()) { - sprintf(machbuf, "DraCo rev.%d", is_draco()); + snprintf(machbuf, sizeof(machbuf), "DraCo rev.%d", is_draco()); mach = machbuf; } else #endif @@ -327,7 +327,7 @@ identifycpu(void) #ifdef M68060 if (machineid & AMIGA_68060) { __asm(".word 0x4e7a,0x0808; movl %%d0,%0" : "=d"(pcr) : : "d0"); - sprintf(cpubuf, "68%s060 rev.%d", + snprintf(cpubuf, sizeof(cpubuf), "68%s060 rev.%d", pcr & 0x10000 ? "LC/EC" : "", (pcr>>8)&0xff); cpu_type = cpubuf; mmu = "/MMU"; @@ -367,7 +367,8 @@ identifycpu(void) fputype = FPU_NONE; } } - sprintf(cpu_model, "%s (%s CPU%s%s)", mach, cpu_type, mmu, fpu); + snprintf(cpu_model, sizeof(cpu_model), "%s (%s CPU%s%s)", mach, + cpu_type, mmu, fpu); printf("%s\n", cpu_model); } @@ -820,39 +821,35 @@ int *nofault; int badaddr(register void *addr) { - register int i; + int i; label_t faultbuf; -#ifdef lint - i = *addr; if (i) return(0); -#endif nofault = (int *) &faultbuf; if (setjmp((label_t *)nofault)) { - nofault = (int *) 0; - return(1); + nofault = NULL; + return 1; } i = *(volatile short *)addr; - nofault = (int *) 0; - return(0); + __USE(i); + nofault = NULL; + return 0; } int badbaddr(register void *addr) { - register int i; + int i; label_t faultbuf; -#ifdef lint - i = *addr; if (i) return(0); -#endif nofault = (int *) &faultbuf; if (setjmp((label_t *)nofault)) { - nofault = (int *) 0; - return(1); + nofault = NULL; + return 1; } i = *(volatile char *)addr; - nofault = (int *) 0; - return(0); + __USE(i); + nofault = NULL; + return 0; } struct isr *isr_ports; diff --git a/sys/arch/amiga/dev/aucc.c b/sys/arch/amiga/dev/aucc.c index 2ad31237d725..59b12fe4ea23 100644 --- a/sys/arch/amiga/dev/aucc.c +++ b/sys/arch/amiga/dev/aucc.c @@ -1,4 +1,4 @@ -/* $NetBSD: aucc.c,v 1.42 2012/10/27 17:17:27 chs Exp $ */ +/* $NetBSD: aucc.c,v 1.43 2014/03/22 01:52:44 christos Exp $ */ /* * Copyright (c) 1999 Bernardo Innocenti @@ -53,7 +53,7 @@ #if NAUCC > 0 #include -__KERNEL_RCSID(0, "$NetBSD: aucc.c,v 1.42 2012/10/27 17:17:27 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: aucc.c,v 1.43 2014/03/22 01:52:44 christos Exp $"); #include #include @@ -927,9 +927,11 @@ aucc_query_devinfo(void *addr, register mixer_devinfo_t *dip) dip->type = AUDIO_MIXER_SET; dip->mixer_class = AUCC_OUTPUT_CLASS; dip->prev = dip->next = AUDIO_MIXER_LAST; - strcpy(dip->label.name, AudioNspeaker); +#define setname(a) strlcpy(dip->label.name, (a), sizeof(dip->label.name)) + setname(AudioNspeaker); for (i = 0; i < 16; i++) { - sprintf(dip->un.s.member[i].label.name, + snprintf(dip->un.s.member[i].label.name, + sizeof(dip->un.s.member[i].label.name), "channelmask%d", i); dip->un.s.member[i].mask = i; } @@ -940,7 +942,7 @@ aucc_query_devinfo(void *addr, register mixer_devinfo_t *dip) dip->type = AUDIO_MIXER_VALUE; dip->mixer_class = AUCC_OUTPUT_CLASS; dip->prev = dip->next = AUDIO_MIXER_LAST; - strcpy(dip->label.name, AudioNmaster); + setname(AudioNmaster); dip->un.v.num_channels = 4; strcpy(dip->un.v.units.name, AudioNvolume); break; @@ -949,7 +951,7 @@ aucc_query_devinfo(void *addr, register mixer_devinfo_t *dip) dip->type = AUDIO_MIXER_CLASS; dip->mixer_class = AUCC_OUTPUT_CLASS; dip->next = dip->prev = AUDIO_MIXER_LAST; - strcpy(dip->label.name, AudioCoutputs); + setname(AudioCoutputs); break; default: diff --git a/sys/arch/amiga/dev/drsc.c b/sys/arch/amiga/dev/drsc.c index a091df9e05ff..83fac3ad1ec7 100644 --- a/sys/arch/amiga/dev/drsc.c +++ b/sys/arch/amiga/dev/drsc.c @@ -1,4 +1,4 @@ -/* $NetBSD: drsc.c,v 1.32 2012/10/27 17:17:28 chs Exp $ */ +/* $NetBSD: drsc.c,v 1.33 2014/03/22 01:52:44 christos Exp $ */ /* * Copyright (c) 1996 Ignatios Souvatzis @@ -59,7 +59,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: drsc.c,v 1.32 2012/10/27 17:17:28 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: drsc.c,v 1.33 2014/03/22 01:52:44 christos Exp $"); #include #include @@ -115,15 +115,12 @@ void drscattach(device_t parent, device_t self, void *aux) { struct siop_softc *sc = device_private(self); - struct zbus_args *zap; siop_regmap_p rp; struct scsipi_adapter *adapt = &sc->sc_adapter; struct scsipi_channel *chan = &sc->sc_channel; printf("\n"); - zap = aux; - sc->sc_dev = self; sc->sc_siopp = rp = (siop_regmap_p)(DRCCADDR+PAGE_SIZE*DRSCSIPG); diff --git a/sys/arch/amiga/dev/ite.c b/sys/arch/amiga/dev/ite.c index ff863de4fb84..600dc51b317a 100644 --- a/sys/arch/amiga/dev/ite.c +++ b/sys/arch/amiga/dev/ite.c @@ -1,4 +1,4 @@ -/* $NetBSD: ite.c,v 1.96 2014/03/16 05:20:22 dholland Exp $ */ +/* $NetBSD: ite.c,v 1.97 2014/03/22 01:52:44 christos Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -46,7 +46,7 @@ #include "opt_ddb.h" #include -__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.96 2014/03/16 05:20:22 dholland Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.97 2014/03/22 01:52:44 christos Exp $"); #include #include @@ -1642,7 +1642,8 @@ iteputchar(register int c, struct ite_softc *ip) break; case 6: /* cursor position report */ - sprintf(ip->argbuf, "\033[%d;%dR", + snprintf(ip->argbuf, sizeof(ip->argbuf), + "\033[%d;%dR", ip->cury + 1, ip->curx + 1); ite_sendstr(ip->argbuf); break; diff --git a/sys/arch/amiga/pci/em4k.c b/sys/arch/amiga/pci/em4k.c index cfe30cbb55c4..dc0c6e1d23a4 100644 --- a/sys/arch/amiga/pci/em4k.c +++ b/sys/arch/amiga/pci/em4k.c @@ -1,4 +1,4 @@ -/* $NetBSD: em4k.c,v 1.2 2013/01/29 21:02:50 rkujawa Exp $ */ +/* $NetBSD: em4k.c,v 1.3 2014/03/22 01:52:44 christos Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -314,9 +314,6 @@ em4k_pci_conf_read(pci_chipset_tag_t pc, pcitag_t tag, int reg) { uint32_t data; uint32_t bus, dev, func; - struct em4k_softc *sc; - - sc = pc->cookie; pci_decompose_tag(pc, tag, &bus, &dev, &func); @@ -335,10 +332,7 @@ void em4k_pci_conf_write(pci_chipset_tag_t pc, pcitag_t tag, int reg, pcireg_t val) { uint32_t bus, dev, func; - struct em4k_softc *sc; - sc = pc->cookie; - pci_decompose_tag(pc, tag, &bus, &dev, &func); bus_space_write_4(pc->pci_conf_datat, pc->pci_conf_datah, diff --git a/sys/arch/amiga/pci/p5pb.c b/sys/arch/amiga/pci/p5pb.c index c18e831324ac..56aa207be3c5 100644 --- a/sys/arch/amiga/pci/p5pb.c +++ b/sys/arch/amiga/pci/p5pb.c @@ -1,4 +1,4 @@ -/* $NetBSD: p5pb.c,v 1.12 2012/10/27 17:17:34 chs Exp $ */ +/* $NetBSD: p5pb.c,v 1.13 2014/03/22 01:52:44 christos Exp $ */ /*- * Copyright (c) 2011, 2012 The NetBSD Foundation, Inc. @@ -321,6 +321,7 @@ p5pb_find_resources(struct p5pb_softc *sc) void p5pb_set_props(struct p5pb_softc *sc) { +#if NGENFB > 0 prop_dictionary_t dict; device_t dev; @@ -328,7 +329,6 @@ p5pb_set_props(struct p5pb_softc *sc) dict = device_properties(dev); /* genfb needs additional properties, like virtual, physical address */ -#if (NGENFB > 0) /* XXX: currently genfb is supported only on CVPPC/BVPPC */ prop_dictionary_set_uint64(dict, "virtual_address", sc->pci_mem_area.base); diff --git a/sys/arch/amiga/pci/pci_machdep.c b/sys/arch/amiga/pci/pci_machdep.c index 5159d73bf239..2498234c85ee 100644 --- a/sys/arch/amiga/pci/pci_machdep.c +++ b/sys/arch/amiga/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.c,v 1.1 2011/09/19 19:15:29 rkujawa Exp $ */ +/* $NetBSD: pci_machdep.c,v 1.2 2014/03/22 01:52:44 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -101,7 +101,7 @@ amiga_pci_intr_string(pci_chipset_tag_t pc, pci_intr_handle_t ih) { static char str[10]; - sprintf(str, "INT%d", (int) ih); + snprintf(str, sizeof(str), "INT%d", (int) ih); return str; } diff --git a/sys/arch/amiga/stand/bootblock/boot/printf.s b/sys/arch/amiga/stand/bootblock/boot/printf.s index 80394de8c2ba..239441f98a9a 100644 --- a/sys/arch/amiga/stand/bootblock/boot/printf.s +++ b/sys/arch/amiga/stand/bootblock/boot/printf.s @@ -1,4 +1,4 @@ -/* $NetBSD: printf.s,v 1.8 2008/04/28 20:23:13 martin Exp $ */ +/* $NetBSD: printf.s,v 1.9 2014/03/22 01:52:44 christos Exp $ */ /*- * Copyright (c) 1996,2006 The NetBSD Foundation, Inc. @@ -56,6 +56,7 @@ Lstorech: movb %d0, %a3@+ rts +#ifdef notdef ENTRY_NOPROFILE(sprintf) movml #0x0032,%sp@- movl %sp@(16),%a3 @@ -66,6 +67,7 @@ ENTRY_NOPROFILE(sprintf) jsr %a6@(-0x20a) movml %sp@+, #0x4c00 rts +#endif /* * XXX cheating - at least for now.