Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm kill sprintf
details: https://anonhg.NetBSD.org/src/rev/bb36ccca2509
branches: trunk
changeset: 328096:bb36ccca2509
user: christos <christos%NetBSD.org@localhost>
date: Wed Mar 26 08:51:59 2014 +0000
description:
kill sprintf
diffstat:
sys/arch/arm/at91/at91aic.c | 6 +++---
sys/arch/arm/ep93xx/ep93xx_intr.c | 6 +++---
sys/arch/arm/footbridge/footbridge_irqhandler.c | 6 +++---
sys/arch/arm/footbridge/footbridge_pci.c | 8 ++++----
sys/arch/arm/footbridge/isa/isa_machdep.c | 6 +++---
sys/arch/arm/iomd/iomd_irqhandler.c | 25 ++++++++-----------------
sys/arch/arm/ixp12x0/ixp12x0_intr.c | 6 +++---
sys/arch/arm/marvell/pci_machdep.c | 7 ++++---
sys/arch/arm/omap/omap_intr.c | 7 ++++---
sys/arch/arm/omap/ti_iic.c | 8 ++++----
sys/arch/arm/s3c2xx0/s3c2xx0_intr.c | 7 ++++---
sys/arch/arm/xscale/ixp425_intr.c | 6 +++---
12 files changed, 46 insertions(+), 52 deletions(-)
diffs (truncated from 371 to 300 lines):
diff -r ec8a105c3e8a -r bb36ccca2509 sys/arch/arm/at91/at91aic.c
--- a/sys/arch/arm/at91/at91aic.c Wed Mar 26 08:40:58 2014 +0000
+++ b/sys/arch/arm/at91/at91aic.c Wed Mar 26 08:51:59 2014 +0000
@@ -1,5 +1,5 @@
-/* $Id: at91aic.c,v 1.10 2012/11/12 18:00:36 skrll Exp $ */
-/* $NetBSD: at91aic.c,v 1.10 2012/11/12 18:00:36 skrll Exp $ */
+/* $Id: at91aic.c,v 1.11 2014/03/26 08:51:59 christos Exp $ */
+/* $NetBSD: at91aic.c,v 1.11 2014/03/26 08:51:59 christos Exp $ */
/*
* Copyright (c) 2007 Embedtronics Oy.
@@ -251,7 +251,7 @@
iq = &intrq[i];
TAILQ_INIT(&iq->iq_list);
- sprintf(iq->iq_name, "irq %d", i);
+ snprintf(iq->iq_name, sizeof(iq->iq_name), "irq %d", i);
}
/* All interrupts should use IRQ not FIQ */
diff -r ec8a105c3e8a -r bb36ccca2509 sys/arch/arm/ep93xx/ep93xx_intr.c
--- a/sys/arch/arm/ep93xx/ep93xx_intr.c Wed Mar 26 08:40:58 2014 +0000
+++ b/sys/arch/arm/ep93xx/ep93xx_intr.c Wed Mar 26 08:51:59 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ep93xx_intr.c,v 1.21 2014/03/02 13:22:32 joerg Exp $ */
+/* $NetBSD: ep93xx_intr.c,v 1.22 2014/03/26 08:51:59 christos Exp $ */
/*
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ep93xx_intr.c,v 1.21 2014/03/02 13:22:32 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ep93xx_intr.c,v 1.22 2014/03/26 08:51:59 christos Exp $");
/*
* Interrupt support for the Cirrus Logic EP93XX
@@ -255,7 +255,7 @@
iq = &intrq[i];
TAILQ_INIT(&iq->iq_list);
- sprintf(iq->iq_name, "irq %d", i);
+ snprintf(iq->iq_name, sizeof(iq->iq_name), "irq %d", i);
evcnt_attach_dynamic(&iq->iq_ev, EVCNT_TYPE_INTR,
NULL, (i < VIC_NIRQ ? "vic1" : "vic2"),
iq->iq_name);
diff -r ec8a105c3e8a -r bb36ccca2509 sys/arch/arm/footbridge/footbridge_irqhandler.c
--- a/sys/arch/arm/footbridge/footbridge_irqhandler.c Wed Mar 26 08:40:58 2014 +0000
+++ b/sys/arch/arm/footbridge/footbridge_irqhandler.c Wed Mar 26 08:51:59 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: footbridge_irqhandler.c,v 1.23 2010/12/20 00:25:27 matt Exp $ */
+/* $NetBSD: footbridge_irqhandler.c,v 1.24 2014/03/26 08:51:59 christos Exp $ */
/*
* Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
#endif
#include <sys/cdefs.h>
-__KERNEL_RCSID(0,"$NetBSD: footbridge_irqhandler.c,v 1.23 2010/12/20 00:25:27 matt Exp $");
+__KERNEL_RCSID(0,"$NetBSD: footbridge_irqhandler.c,v 1.24 2014/03/26 08:51:59 christos Exp $");
#include "opt_irqstats.h"
@@ -196,7 +196,7 @@
for (i = 0, iq = footbridge_intrq; i < NIRQ; i++, iq++) {
TAILQ_INIT(&iq->iq_list);
- sprintf(iq->iq_name, "irq %d", i);
+ snprintf(iq->iq_name, sizeof(iq->iq_name), "irq %d", i);
evcnt_attach_dynamic(&iq->iq_ev, EVCNT_TYPE_INTR,
NULL, "footbridge", iq->iq_name);
}
diff -r ec8a105c3e8a -r bb36ccca2509 sys/arch/arm/footbridge/footbridge_pci.c
--- a/sys/arch/arm/footbridge/footbridge_pci.c Wed Mar 26 08:40:58 2014 +0000
+++ b/sys/arch/arm/footbridge/footbridge_pci.c Wed Mar 26 08:51:59 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: footbridge_pci.c,v 1.24 2012/10/27 17:17:37 chs Exp $ */
+/* $NetBSD: footbridge_pci.c,v 1.25 2014/03/26 08:51:59 christos Exp $ */
/*
* Copyright (c) 1997,1998 Mark Brinicombe.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: footbridge_pci.c,v 1.24 2012/10/27 17:17:37 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: footbridge_pci.c,v 1.25 2014/03/26 08:51:59 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -318,11 +318,11 @@
#if NISA > 0
if (ih >= 0x80 && ih <= 0x8f) {
- sprintf(irqstr, "isairq %ld", (ih & 0x0f));
+ snprintf(irqstr, sizeof(irqstr), "isairq %ld", (ih & 0x0f));
return(irqstr);
}
#endif
- sprintf(irqstr, "irq %ld", ih);
+ snprintf(irqstr, sizeof(irqstr), "irq %ld", ih);
return(irqstr);
}
diff -r ec8a105c3e8a -r bb36ccca2509 sys/arch/arm/footbridge/isa/isa_machdep.c
--- a/sys/arch/arm/footbridge/isa/isa_machdep.c Wed Mar 26 08:40:58 2014 +0000
+++ b/sys/arch/arm/footbridge/isa/isa_machdep.c Wed Mar 26 08:51:59 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: isa_machdep.c,v 1.20 2013/11/17 08:32:55 skrll Exp $ */
+/* $NetBSD: isa_machdep.c,v 1.21 2014/03/26 08:52:00 christos Exp $ */
/*-
* Copyright (c) 1996-1998 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isa_machdep.c,v 1.20 2013/11/17 08:32:55 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isa_machdep.c,v 1.21 2014/03/26 08:52:00 christos Exp $");
#include "opt_irqstats.h"
@@ -440,7 +440,7 @@
iq = &isa_intrq[i];
TAILQ_INIT(&iq->iq_list);
- sprintf(iq->iq_name, "irq %d", i);
+ snprintf(iq->iq_name, sizeof(iq->iq_name), "irq %d", i);
evcnt_attach_dynamic(&iq->iq_ev, EVCNT_TYPE_INTR,
NULL, "isa", iq->iq_name);
}
diff -r ec8a105c3e8a -r bb36ccca2509 sys/arch/arm/iomd/iomd_irqhandler.c
--- a/sys/arch/arm/iomd/iomd_irqhandler.c Wed Mar 26 08:40:58 2014 +0000
+++ b/sys/arch/arm/iomd/iomd_irqhandler.c Wed Mar 26 08:51:59 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iomd_irqhandler.c,v 1.18 2010/12/20 00:25:28 matt Exp $ */
+/* $NetBSD: iomd_irqhandler.c,v 1.19 2014/03/26 08:52:00 christos Exp $ */
/*
* Copyright (c) 1994-1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: iomd_irqhandler.c,v 1.18 2010/12/20 00:25:28 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iomd_irqhandler.c,v 1.19 2014/03/26 08:52:00 christos Exp $");
#include "opt_irqstats.h"
@@ -178,14 +178,11 @@
#ifdef IRQSTATS
/* Get the interrupt name from the head of the list */
+ char *iptr = _intrnames + (irq * 14);
if (handler->ih_name) {
- char *ptr = _intrnames + (irq * 14);
- strcpy(ptr, " ");
- strncpy(ptr, handler->ih_name,
- min(strlen(handler->ih_name), 13));
+ strlcpy(iptr, handler->ih_name, 14)
} else {
- char *ptr = _intrnames + (irq * 14);
- sprintf(ptr, "irq %2d ", irq);
+ snprintf(iptr, 14, "irq %2d ", irq);
}
#endif /* IRQSTATS */
@@ -255,9 +252,6 @@
int level;
irqhandler_t *irqhand;
irqhandler_t **prehand;
-#ifdef IRQSTATS
- extern char *_intrnames;
-#endif
/*
* IRQ_INSTRUCT indicates that we should get the irq number
@@ -294,14 +288,11 @@
#ifdef IRQSTATS
/* Get the interrupt name from the head of the list */
+ char *iptr = _intrnames + (irq * 14);
if (irqhandlers[irq] && irqhandlers[irq]->ih_name) {
- char *ptr = _intrnames + (irq * 14);
- strcpy(ptr, " ");
- strncpy(ptr, irqhandlers[irq]->ih_name,
- min(strlen(irqhandlers[irq]->ih_name), 13));
+ strlcpy(iptr, irqhandlers[irq]->ih_name, 14);
} else {
- char *ptr = _intrnames + (irq * 14);
- sprintf(ptr, "irq %2d ", irq);
+ snprintf(iptr, 14, "irq %2d ", irq);
}
#endif /* IRQSTATS */
diff -r ec8a105c3e8a -r bb36ccca2509 sys/arch/arm/ixp12x0/ixp12x0_intr.c
--- a/sys/arch/arm/ixp12x0/ixp12x0_intr.c Wed Mar 26 08:40:58 2014 +0000
+++ b/sys/arch/arm/ixp12x0/ixp12x0_intr.c Wed Mar 26 08:51:59 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixp12x0_intr.c,v 1.28 2014/03/20 06:48:54 skrll Exp $ */
+/* $NetBSD: ixp12x0_intr.c,v 1.29 2014/03/26 08:52:00 christos Exp $ */
/*
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ixp12x0_intr.c,v 1.28 2014/03/20 06:48:54 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixp12x0_intr.c,v 1.29 2014/03/26 08:52:00 christos Exp $");
/*
* Interrupt support for the Intel ixp12x0
@@ -312,7 +312,7 @@
iq = &intrq[i];
TAILQ_INIT(&iq->iq_list);
- sprintf(iq->iq_name, "ipl %d", i);
+ snprintf(iq->iq_name, sizeof(iq->iq_name), "ipl %d", i);
evcnt_attach_dynamic(&iq->iq_ev, EVCNT_TYPE_INTR,
NULL, "ixpintr", iq->iq_name);
}
diff -r ec8a105c3e8a -r bb36ccca2509 sys/arch/arm/marvell/pci_machdep.c
--- a/sys/arch/arm/marvell/pci_machdep.c Wed Mar 26 08:40:58 2014 +0000
+++ b/sys/arch/arm/marvell/pci_machdep.c Wed Mar 26 08:51:59 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_machdep.c,v 1.5 2013/05/01 12:38:06 rkujawa Exp $ */
+/* $NetBSD: pci_machdep.c,v 1.6 2014/03/26 08:52:00 christos Exp $ */
/*
* Copyright (c) 2008 KIYOHARA Takashi
* All rights reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.5 2013/05/01 12:38:06 rkujawa Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.6 2014/03/26 08:52:00 christos Exp $");
#include "opt_mvsoc.h"
#include "gtpci.h"
@@ -321,7 +321,8 @@
int2gpp = prop_dictionary_get(device_properties(sc->sc_dev), "int2gpp");
gpp = prop_array_get(int2gpp, pin);
- sprintf(intrstr, "gpp %d", (int)prop_number_integer_value(gpp));
+ snprintf(intrstr, sizeof(intrstr), "gpp %d",
+ (int)prop_number_integer_value(gpp));
return intrstr;
}
diff -r ec8a105c3e8a -r bb36ccca2509 sys/arch/arm/omap/omap_intr.c
--- a/sys/arch/arm/omap/omap_intr.c Wed Mar 26 08:40:58 2014 +0000
+++ b/sys/arch/arm/omap/omap_intr.c Wed Mar 26 08:51:59 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: omap_intr.c,v 1.10 2014/02/04 18:51:16 matt Exp $ */
+/* $NetBSD: omap_intr.c,v 1.11 2014/03/26 08:52:00 christos Exp $ */
/*
* Based on arch/arm/xscale/pxa2x0_intr.c
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: omap_intr.c,v 1.10 2014/02/04 18:51:16 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap_intr.c,v 1.11 2014/03/26 08:52:00 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -174,7 +174,8 @@
handler[i].func = stray_interrupt;
handler[i].cookie = (void *)(intptr_t) i;
extirq_level[i] = IPL_SERIAL;
- sprintf(handler[i].irq_num_str, "#%d", i);
+ snprintf(handler[i].irq_num_str,
+ sizeof(handler[i].irq_num_str), "#%d", i);
if (handler[i].name == NULL)
omapintc_set_name(i, handler[i].irq_num_str, false);
}
diff -r ec8a105c3e8a -r bb36ccca2509 sys/arch/arm/omap/ti_iic.c
--- a/sys/arch/arm/omap/ti_iic.c Wed Mar 26 08:40:58 2014 +0000
+++ b/sys/arch/arm/omap/ti_iic.c Wed Mar 26 08:51:59 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ti_iic.c,v 1.5 2013/12/18 12:54:35 skrll Exp $ */
+/* $NetBSD: ti_iic.c,v 1.6 2014/03/26 08:52:00 christos Exp $ */
/*
* Copyright (c) 2013 Manuel Bouyer. All rights reserved.
@@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ti_iic.c,v 1.5 2013/12/18 12:54:35 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ti_iic.c,v 1.6 2014/03/26 08:52:00 christos Exp $");
#include "opt_omap.h"
#include "locators.h"
@@ -238,7 +238,7 @@
}
Home |
Main Index |
Thread Index |
Old Index