Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/hppa fix eisa_intr_string



details:   https://anonhg.NetBSD.org/src/rev/8aa64374e12a
branches:  trunk
changeset: 795082:8aa64374e12a
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Mar 31 20:51:20 2014 +0000

description:
fix eisa_intr_string

diffstat:

 sys/arch/hppa/dev/apic.c             |   8 +++-----
 sys/arch/hppa/dev/dino.c             |  12 +++++-------
 sys/arch/hppa/dev/elroyvar.h         |   4 ++--
 sys/arch/hppa/dev/mongoose.c         |  12 +++++-------
 sys/arch/hppa/include/eisa_machdep.h |   4 ++--
 5 files changed, 17 insertions(+), 23 deletions(-)

diffs (141 lines):

diff -r 5f354babfe3a -r 8aa64374e12a sys/arch/hppa/dev/apic.c
--- a/sys/arch/hppa/dev/apic.c  Mon Mar 31 20:46:41 2014 +0000
+++ b/sys/arch/hppa/dev/apic.c  Mon Mar 31 20:51:20 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: apic.c,v 1.1 2014/02/24 07:23:42 skrll Exp $   */
+/*     $NetBSD: apic.c,v 1.2 2014/03/31 20:51:20 christos Exp $        */
 
 /*     $OpenBSD: apic.c,v 1.14 2011/05/01 21:59:39 kettenis Exp $      */
 
@@ -146,11 +146,9 @@
 }
 
 const char *
-apic_intr_string(void *v, pci_intr_handle_t ih)
+apic_intr_string(void *v, pci_intr_handle_t ih, char *buf, size_t len)
 {
-       static char buf[32];
-
-       snprintf(buf, sizeof(buf), "line %ld irq %ld",
+       snprintf(buf, len, "line %ld irq %ld",
            APIC_INT_LINE(ih), APIC_INT_IRQ(ih));
 
        return buf;
diff -r 5f354babfe3a -r 8aa64374e12a sys/arch/hppa/dev/dino.c
--- a/sys/arch/hppa/dev/dino.c  Mon Mar 31 20:46:41 2014 +0000
+++ b/sys/arch/hppa/dev/dino.c  Mon Mar 31 20:51:20 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dino.c,v 1.1 2014/02/24 07:23:42 skrll Exp $ */
+/*     $NetBSD: dino.c,v 1.2 2014/03/31 20:51:20 christos Exp $ */
 
 /*     $OpenBSD: dino.c,v 1.5 2004/02/13 20:39:31 mickey Exp $ */
 
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.1 2014/02/24 07:23:42 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.2 2014/03/31 20:51:20 christos Exp $");
 
 /* #include "cardbus.h" */
 
@@ -149,7 +149,7 @@
 void dino_conf_write(void *, pcitag_t, int, pcireg_t);
 
 int dino_intr_map(const struct pci_attach_args *, pci_intr_handle_t *);
-const char *dino_intr_string(void *, pci_intr_handle_t);
+const char *dino_intr_string(void *, pci_intr_handle_t, char *, size_t);
 void *dino_intr_establish(void *, pci_intr_handle_t, int,
     int (*)(void *), void *);
 void dino_intr_disestablish(void *, void *);
@@ -387,11 +387,9 @@
 }
 
 const char *
-dino_intr_string(void *v, pci_intr_handle_t ih)
+dino_intr_string(void *v, pci_intr_handle_t ih, char *buf, size_t len)
 {
-       static char buf[32];
-
-       snprintf(buf, 32, "irq %ld", ih);
+       snprintf(buf, len, "irq %ld", ih);
        return buf;
 }
 
diff -r 5f354babfe3a -r 8aa64374e12a sys/arch/hppa/dev/elroyvar.h
--- a/sys/arch/hppa/dev/elroyvar.h      Mon Mar 31 20:46:41 2014 +0000
+++ b/sys/arch/hppa/dev/elroyvar.h      Mon Mar 31 20:51:20 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: elroyvar.h,v 1.1 2014/02/24 07:23:42 skrll Exp $       */
+/*     $NetBSD: elroyvar.h,v 1.2 2014/03/31 20:51:20 christos Exp $    */
 
 /*     $OpenBSD: elroyvar.h,v 1.3 2007/06/17 14:51:21 kettenis Exp $   */
 
@@ -50,7 +50,7 @@
 void apic_attach(struct elroy_softc *);
 int apic_intr(void *);
 int apic_intr_map(const struct pci_attach_args *, pci_intr_handle_t *);
-const char *apic_intr_string(void *, pci_intr_handle_t);
+const char *apic_intr_string(void *, pci_intr_handle_t, char *, size_t);
 void *apic_intr_establish(void *, pci_intr_handle_t, int,
     int (*)(void *), void *);
 void apic_intr_disestablish(void *, void *);
diff -r 5f354babfe3a -r 8aa64374e12a sys/arch/hppa/dev/mongoose.c
--- a/sys/arch/hppa/dev/mongoose.c      Mon Mar 31 20:46:41 2014 +0000
+++ b/sys/arch/hppa/dev/mongoose.c      Mon Mar 31 20:51:20 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mongoose.c,v 1.2 2014/03/26 17:57:17 christos Exp $    */
+/*     $NetBSD: mongoose.c,v 1.3 2014/03/31 20:51:20 christos Exp $    */
 
 /*     $OpenBSD: mongoose.c,v 1.19 2010/01/01 20:28:42 kettenis Exp $  */
 
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mongoose.c,v 1.2 2014/03/26 17:57:17 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mongoose.c,v 1.3 2014/03/31 20:51:20 christos Exp $");
 
 #define MONGOOSE_DEBUG 9
 
@@ -205,7 +205,7 @@
 
 void mg_eisa_attach_hook(device_t, device_t, struct eisabus_attach_args *);
 int mg_intr_map(void *, u_int, eisa_intr_handle_t *);
-const char *mg_intr_string(void *, int);
+const char *mg_intr_string(void *, int, char *, size_t);
 void mg_isa_attach_hook(device_t, device_t, struct isabus_attach_args *);
 void mg_isa_detach_hook(isa_chipset_tag_t, device_t);
 void *mg_intr_establish(void *, int, int, int, int (*)(void *), void *);
@@ -255,11 +255,9 @@
 }
 
 const char *
-mg_intr_string(void *v, int irq)
+mg_intr_string(void *v, int irq, char *buf, size_t len)
 {
-       static char buf[16];
-
-       snprintf (buf, sizeof(buf), "isa irq %d", irq);
+       snprintf (buf, len, "isa irq %d", irq);
        return buf;
 }
 
diff -r 5f354babfe3a -r 8aa64374e12a sys/arch/hppa/include/eisa_machdep.h
--- a/sys/arch/hppa/include/eisa_machdep.h      Mon Mar 31 20:46:41 2014 +0000
+++ b/sys/arch/hppa/include/eisa_machdep.h      Mon Mar 31 20:51:20 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: eisa_machdep.h,v 1.2 2014/03/29 19:28:28 christos Exp $        */
+/*     $NetBSD: eisa_machdep.h,v 1.3 2014/03/31 20:51:20 christos Exp $        */
 
 /*     $OpenBSD: eisa_machdep.h,v 1.2 2000/04/18 20:55:02 mickey Exp $ */
 
@@ -40,7 +40,7 @@
        void    (*ec_attach_hook)(device_t, device_t,
                                       struct eisabus_attach_args *);
        int     (*ec_intr_map)(void *, u_int, int *);
-       const char *(*ec_intr_string)(void *, int);
+       const char *(*ec_intr_string)(void *, int, char *, size_t);
        void    *(*ec_intr_establish)(void *, int, int, int,
                                           int (*)(void *), void *);
        void    (*ec_intr_disestablish)(void *, void *);



Home | Main Index | Thread Index | Old Index