Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/amiga kill sprintf
details: https://anonhg.NetBSD.org/src/rev/a3d2a774d889
branches: trunk
changeset: 327945:a3d2a774d889
user: christos <christos%NetBSD.org@localhost>
date: Sat Mar 22 01:52:44 2014 +0000
description:
kill sprintf
fix unused variables
diffstat:
sys/arch/amiga/amiga/machdep.c | 39 ++++++++++++---------------
sys/arch/amiga/dev/aucc.c | 14 +++++----
sys/arch/amiga/dev/drsc.c | 7 +---
sys/arch/amiga/dev/ite.c | 7 ++--
sys/arch/amiga/pci/em4k.c | 8 +-----
sys/arch/amiga/pci/p5pb.c | 4 +-
sys/arch/amiga/pci/pci_machdep.c | 4 +-
sys/arch/amiga/stand/bootblock/boot/printf.s | 4 ++-
8 files changed, 40 insertions(+), 47 deletions(-)
diffs (truncated from 308 to 300 lines):
diff -r 38689e7eb308 -r a3d2a774d889 sys/arch/amiga/amiga/machdep.c
--- a/sys/arch/amiga/amiga/machdep.c Sat Mar 22 00:04:51 2014 +0000
+++ b/sys/arch/amiga/amiga/machdep.c Sat Mar 22 01:52:44 2014 +0000
@@ -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 <sys/cdefs.h>
-__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 <sys/param.h>
#include <sys/systm.h>
@@ -308,7 +308,7 @@
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 @@
#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 @@
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
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 -r 38689e7eb308 -r a3d2a774d889 sys/arch/amiga/dev/aucc.c
--- a/sys/arch/amiga/dev/aucc.c Sat Mar 22 00:04:51 2014 +0000
+++ b/sys/arch/amiga/dev/aucc.c Sat Mar 22 01:52:44 2014 +0000
@@ -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 <sys/cdefs.h>
-__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 <sys/param.h>
#include <sys/systm.h>
@@ -927,9 +927,11 @@
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 @@
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 @@
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 -r 38689e7eb308 -r a3d2a774d889 sys/arch/amiga/dev/drsc.c
--- a/sys/arch/amiga/dev/drsc.c Sat Mar 22 00:04:51 2014 +0000
+++ b/sys/arch/amiga/dev/drsc.c Sat Mar 22 01:52:44 2014 +0000
@@ -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 <sys/cdefs.h>
-__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 <sys/param.h>
#include <sys/systm.h>
@@ -115,15 +115,12 @@
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 -r 38689e7eb308 -r a3d2a774d889 sys/arch/amiga/dev/ite.c
--- a/sys/arch/amiga/dev/ite.c Sat Mar 22 00:04:51 2014 +0000
+++ b/sys/arch/amiga/dev/ite.c Sat Mar 22 01:52:44 2014 +0000
@@ -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 <sys/cdefs.h>
-__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 <sys/param.h>
#include <sys/kernel.h>
@@ -1642,7 +1642,8 @@
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 -r 38689e7eb308 -r a3d2a774d889 sys/arch/amiga/pci/em4k.c
--- a/sys/arch/amiga/pci/em4k.c Sat Mar 22 00:04:51 2014 +0000
+++ b/sys/arch/amiga/pci/em4k.c Sat Mar 22 01:52:44 2014 +0000
@@ -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 @@
{
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 @@
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 -r 38689e7eb308 -r a3d2a774d889 sys/arch/amiga/pci/p5pb.c
--- a/sys/arch/amiga/pci/p5pb.c Sat Mar 22 00:04:51 2014 +0000
+++ b/sys/arch/amiga/pci/p5pb.c Sat Mar 22 01:52:44 2014 +0000
@@ -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 @@
void
p5pb_set_props(struct p5pb_softc *sc)
{
+#if NGENFB > 0
prop_dictionary_t dict;
device_t dev;
@@ -328,7 +329,6 @@
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 -r 38689e7eb308 -r a3d2a774d889 sys/arch/amiga/pci/pci_machdep.c
--- a/sys/arch/amiga/pci/pci_machdep.c Sat Mar 22 00:04:51 2014 +0000
+++ b/sys/arch/amiga/pci/pci_machdep.c Sat Mar 22 01:52:44 2014 +0000
@@ -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 @@
{
static char str[10];
- sprintf(str, "INT%d", (int) ih);
+ snprintf(str, sizeof(str), "INT%d", (int) ih);
return str;
}
diff -r 38689e7eb308 -r a3d2a774d889 sys/arch/amiga/stand/bootblock/boot/printf.s
--- a/sys/arch/amiga/stand/bootblock/boot/printf.s Sat Mar 22 00:04:51 2014 +0000
+++ b/sys/arch/amiga/stand/bootblock/boot/printf.s Sat Mar 22 01:52:44 2014 +0000
@@ -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 @@
movb %d0, %a3@+
rts
+#ifdef notdef
ENTRY_NOPROFILE(sprintf)
movml #0x0032,%sp@-
movl %sp@(16),%a3
Home |
Main Index |
Thread Index |
Old Index