Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys - Use aprint*() instead of printf() in xxx_attach().
details: https://anonhg.NetBSD.org/src/rev/5a7cb400776c
branches: trunk
changeset: 346460:5a7cb400776c
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Thu Jul 14 04:00:45 2016 +0000
description:
- Use aprint*() instead of printf() in xxx_attach().
- Add missing aprint_naive("\n");
- KNF
diffstat:
sys/dev/cardbus/ahc_cardbus.c | 8 +-
sys/dev/cardbus/ehci_cardbus.c | 19 +++--
sys/dev/cardbus/ohci_cardbus.c | 13 +--
sys/dev/cardbus/uhci_cardbus.c | 13 +--
sys/dev/eisa/ahb.c | 20 +++--
sys/dev/eisa/dpt_eisa.c | 16 ++--
sys/dev/eisa/if_tlp_eisa.c | 13 +--
sys/dev/gpib/mt.c | 20 +++--
sys/dev/gpio/gpiopwm.c | 41 ++++++------
sys/dev/gpio/gpiosim.c | 6 +-
sys/dev/ic/aic79xx_osm.c | 6 +-
sys/dev/ic/ciss.c | 45 +++++++-------
sys/dev/ic/igsfb.c | 8 +-
sys/dev/ic/tropic.c | 124 +++++++++++++++++++++-------------------
sys/dev/isa/slhci_isa.c | 10 +-
sys/dev/isapnp/if_cs_isapnp.c | 35 +++++-----
sys/dev/isapnp/isic_isapnp.c | 77 +++++++++++-------------
sys/dev/mca/ed_mca.c | 29 ++++----
sys/dev/mca/if_elmc_mca.c | 21 +++---
sys/dev/pci/ahc_pci.c | 22 +++---
sys/dev/pci/ciss_pci.c | 22 +++---
sys/dev/pci/if_atw_pci.c | 12 +-
sys/dev/pci/if_txp.c | 94 +++++++++++++++++++-----------
sys/dev/pci/if_vr.c | 25 ++++---
sys/dev/pci/if_wi_pci.c | 24 +++---
sys/dev/pci/if_xge.c | 55 +++++++++++------
sys/dev/pci/igsfb_pci.c | 6 +-
sys/dev/pci/isp_pci.c | 16 ++--
sys/dev/pci/mfi_pci.c | 6 +-
sys/dev/scsipi/st.c | 20 +++---
sys/dev/scsipi/st_atapi.c | 10 +-
sys/dev/scsipi/uk.c | 7 +-
sys/dev/sdmmc/sbt.c | 10 +-
sys/dev/usb/if_urndis.c | 34 ++++++----
sys/dev/usb/if_urtw.c | 25 ++++---
sys/modules/lua/lua.c | 4 +-
36 files changed, 489 insertions(+), 427 deletions(-)
diffs (truncated from 2879 to 300 lines):
diff -r ecc465bb3ec4 -r 5a7cb400776c sys/dev/cardbus/ahc_cardbus.c
--- a/sys/dev/cardbus/ahc_cardbus.c Thu Jul 14 01:59:18 2016 +0000
+++ b/sys/dev/cardbus/ahc_cardbus.c Thu Jul 14 04:00:45 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ahc_cardbus.c,v 1.35 2011/08/01 11:20:27 drochner Exp $ */
+/* $NetBSD: ahc_cardbus.c,v 1.36 2016/07/14 04:00:45 msaitoh Exp $ */
/*-
* Copyright (c) 2000, 2005 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahc_cardbus.c,v 1.35 2011/08/01 11:20:27 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahc_cardbus.c,v 1.36 2016/07/14 04:00:45 msaitoh Exp $");
#include "opt_ahc_cardbus.h"
@@ -138,7 +138,7 @@
csc->sc_csr |= PCI_COMMAND_IO_ENABLE;
} else {
csc->sc_bar = 0;
- printf("%s: unable to map device registers\n",
+ aprint_error("%s: unable to map device registers\n",
ahc_name(ahc));
return;
}
@@ -194,7 +194,7 @@
*/
ahc->ih = Cardbus_intr_establish(ct, IPL_BIO, ahc_intr, ahc);
if (ahc->ih == NULL) {
- printf("%s: unable to establish interrupt\n",
+ aprint_error("%s: unable to establish interrupt\n",
ahc_name(ahc));
return;
}
diff -r ecc465bb3ec4 -r 5a7cb400776c sys/dev/cardbus/ehci_cardbus.c
--- a/sys/dev/cardbus/ehci_cardbus.c Thu Jul 14 01:59:18 2016 +0000
+++ b/sys/dev/cardbus/ehci_cardbus.c Thu Jul 14 04:00:45 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ehci_cardbus.c,v 1.33 2016/04/23 10:15:31 skrll Exp $ */
+/* $NetBSD: ehci_cardbus.c,v 1.34 2016/07/14 04:00:45 msaitoh Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci_cardbus.c,v 1.33 2016/04/23 10:15:31 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci_cardbus.c,v 1.34 2016/07/14 04:00:45 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -78,7 +78,8 @@
};
CFATTACH_DECL_NEW(ehci_cardbus, sizeof(struct ehci_cardbus_softc),
- ehci_cardbus_match, ehci_cardbus_attach, ehci_cardbus_detach, ehci_activate);
+ ehci_cardbus_match, ehci_cardbus_attach, ehci_cardbus_detach,
+ ehci_activate);
static TAILQ_HEAD(, usb_cardbus) ehci_cardbus_alldevs =
TAILQ_HEAD_INITIALIZER(ehci_cardbus_alldevs);
@@ -135,14 +136,15 @@
sc->sc.sc_dev = self;
sc->sc.sc_bus.ub_hcpriv = sc;
+ aprint_naive("\n");
pci_devinfo(ca->ca_id, ca->ca_class, 0, devinfo, sizeof(devinfo));
- printf(": %s (rev. 0x%02x)\n", devinfo,
+ aprint_normal(": %s (rev. 0x%02x)\n", devinfo,
PCI_REVISION(ca->ca_class));
/* Map I/O registers */
if (Cardbus_mapreg_map(ct, PCI_CBMEM, PCI_MAPREG_TYPE_MEM, 0,
&sc->sc.iot, &sc->sc.ioh, NULL, &sc->sc.sc_size)) {
- printf("%s: can't map mem space\n", devname);
+ aprint_error("%s: can't map mem space\n", devname);
return;
}
@@ -164,7 +166,7 @@
sc->sc_ih = Cardbus_intr_establish(ct, IPL_USB, ehci_intr, sc);
if (sc->sc_ih == NULL) {
- printf("%s: couldn't establish interrupt\n", devname);
+ aprint_error("%s: couldn't establish interrupt\n", devname);
return;
}
@@ -191,7 +193,7 @@
int err = ehci_init(&sc->sc);
if (err) {
- printf("%s: init failed, error=%d\n", devname, err);
+ aprint_error("%s: init failed, error=%d\n", devname, err);
/* Avoid spurious interrupts. */
Cardbus_intr_disestablish(ct, sc->sc_ih);
@@ -231,7 +233,8 @@
}
void
-usb_cardbus_add(struct usb_cardbus *up, struct cardbus_attach_args *ca, device_t bu)
+usb_cardbus_add(struct usb_cardbus *up, struct cardbus_attach_args *ca,
+ device_t bu)
{
TAILQ_INSERT_TAIL(&ehci_cardbus_alldevs, up, next);
up->bus = ca->ca_bus;
diff -r ecc465bb3ec4 -r 5a7cb400776c sys/dev/cardbus/ohci_cardbus.c
--- a/sys/dev/cardbus/ohci_cardbus.c Thu Jul 14 01:59:18 2016 +0000
+++ b/sys/dev/cardbus/ohci_cardbus.c Thu Jul 14 04:00:45 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ohci_cardbus.c,v 1.42 2016/07/07 06:55:41 msaitoh Exp $ */
+/* $NetBSD: ohci_cardbus.c,v 1.43 2016/07/14 04:00:45 msaitoh Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ohci_cardbus.c,v 1.42 2016/07/07 06:55:41 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci_cardbus.c,v 1.43 2016/07/14 04:00:45 msaitoh Exp $");
#include "ehci_cardbus.h"
@@ -121,7 +121,7 @@
/* Map I/O registers */
if (Cardbus_mapreg_map(ct, PCI_CBMEM, PCI_MAPREG_TYPE_MEM, 0,
&sc->sc.iot, &sc->sc.ioh, NULL, &sc->sc.sc_size)) {
- printf("%s: can't map mem space\n", devname);
+ aprint_error("%s: can't map mem space\n", devname);
return;
}
@@ -131,8 +131,7 @@
sc->sc.sc_bus.ub_dmatag = ca->ca_dmat;
/* Enable the device. */
- csr = Cardbus_conf_read(ct, ca->ca_tag,
- PCI_COMMAND_STATUS_REG);
+ csr = Cardbus_conf_read(ct, ca->ca_tag, PCI_COMMAND_STATUS_REG);
Cardbus_conf_write(ct, ca->ca_tag, PCI_COMMAND_STATUS_REG,
csr | PCI_COMMAND_MASTER_ENABLE
| PCI_COMMAND_MEM_ENABLE);
@@ -143,7 +142,7 @@
sc->sc_ih = Cardbus_intr_establish(ct, IPL_USB, ohci_intr, sc);
if (sc->sc_ih == NULL) {
- printf("%s: couldn't establish interrupt\n", devname);
+ aprint_error("%s: couldn't establish interrupt\n", devname);
return;
}
@@ -154,7 +153,7 @@
int err = ohci_init(&sc->sc);
if (err) {
- printf("%s: init failed, error=%d\n", devname, err);
+ aprint_error("%s: init failed, error=%d\n", devname, err);
/* Avoid spurious interrupts. */
Cardbus_intr_disestablish(ct, sc->sc_ih);
diff -r ecc465bb3ec4 -r 5a7cb400776c sys/dev/cardbus/uhci_cardbus.c
--- a/sys/dev/cardbus/uhci_cardbus.c Thu Jul 14 01:59:18 2016 +0000
+++ b/sys/dev/cardbus/uhci_cardbus.c Thu Jul 14 04:00:45 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uhci_cardbus.c,v 1.23 2016/07/07 06:55:41 msaitoh Exp $ */
+/* $NetBSD: uhci_cardbus.c,v 1.24 2016/07/14 04:00:45 msaitoh Exp $ */
/*
* Copyright (c) 1998-2005 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhci_cardbus.c,v 1.23 2016/07/07 06:55:41 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhci_cardbus.c,v 1.24 2016/07/14 04:00:45 msaitoh Exp $");
#include "ehci_cardbus.h"
@@ -89,8 +89,7 @@
}
static void
-uhci_cardbus_attach(device_t parent, device_t self,
- void *aux)
+uhci_cardbus_attach(device_t parent, device_t self, void *aux)
{
struct uhci_cardbus_softc *sc = device_private(self);
struct cardbus_attach_args *ca = (struct cardbus_attach_args *)aux;
@@ -111,7 +110,7 @@
/* Map I/O registers */
if (Cardbus_mapreg_map(ct, PCI_CBIO, PCI_MAPREG_TYPE_IO, 0,
&sc->sc.iot, &sc->sc.ioh, NULL, &sc->sc.sc_size)) {
- printf("%s: can't map i/o space\n", devname);
+ aprint_error("%s: can't map i/o space\n", devname);
return;
}
@@ -132,7 +131,7 @@
/* Map and establish the interrupt. */
sc->sc_ih = Cardbus_intr_establish(ct, IPL_USB, uhci_intr, sc);
if (sc->sc_ih == NULL) {
- printf("%s: couldn't establish interrupt\n", devname);
+ aprint_error("%s: couldn't establish interrupt\n", devname);
return;
}
@@ -161,7 +160,7 @@
int err = uhci_init(&sc->sc);
if (err) {
- printf("%s: init failed, error=%d\n", devname, err);
+ aprint_error("%s: init failed, error=%d\n", devname, err);
/* Avoid spurious interrupts. */
Cardbus_intr_disestablish(ct, sc->sc_ih);
diff -r ecc465bb3ec4 -r 5a7cb400776c sys/dev/eisa/ahb.c
--- a/sys/dev/eisa/ahb.c Thu Jul 14 01:59:18 2016 +0000
+++ b/sys/dev/eisa/ahb.c Thu Jul 14 04:00:45 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ahb.c,v 1.63 2016/07/11 11:31:50 msaitoh Exp $ */
+/* $NetBSD: ahb.c,v 1.64 2016/07/14 04:00:45 msaitoh Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahb.c,v 1.63 2016/07/11 11:31:50 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahb.c,v 1.64 2016/07/14 04:00:45 msaitoh Exp $");
#include "opt_ddb.h"
@@ -148,8 +148,7 @@
* the actual probe routine to check it out.
*/
static int
-ahbmatch(device_t parent, cfdata_t match,
- void *aux)
+ahbmatch(device_t parent, cfdata_t match, void *aux)
{
struct eisa_attach_args *ea = aux;
bus_space_tag_t iot = ea->ea_iot;
@@ -205,7 +204,8 @@
model = EISA_PRODUCT_ADP0400;
else
model = "unknown model!";
- printf(": %s\n", model);
+ aprint_naive("\n");
+ aprint_normal(": %s\n", model);
if (bus_space_map(iot,
EISA_SLOT_ADDR(ea->ea_slot) + AHB_EISA_SLOT_OFFSET,
@@ -574,7 +574,8 @@
break;
default: /* Other scsi protocol messes */
printf("%s: host_stat %x\n",
- device_xname(sc->sc_dev), ecb->ecb_status.host_stat);
+ device_xname(sc->sc_dev),
+ ecb->ecb_status.host_stat);
xs->error = XS_DRIVER_STUFFUP;
}
} else if (ecb->ecb_status.target_stat != SCSI_OK) {
@@ -590,7 +591,8 @@
break;
default:
printf("%s: target_stat %x\n",
- device_xname(sc->sc_dev), ecb->ecb_status.target_stat);
+ device_xname(sc->sc_dev),
+ ecb->ecb_status.target_stat);
xs->error = XS_DRIVER_STUFFUP;
}
} else
@@ -706,8 +708,8 @@
*/
if ((error = bus_dmamem_alloc(sc->sc_dmat, ECBSIZE,
PAGE_SIZE, 0, &seg, 1, &rseg, BUS_DMA_NOWAIT)) != 0) {
- aprint_error_dev(sc->sc_dev, "unable to allocate ecbs, error = %d\n",
- error);
+ aprint_error_dev(sc->sc_dev,
+ "unable to allocate ecbs, error = %d\n", error);
return (error);
}
if ((error = bus_dmamem_map(sc->sc_dmat, &seg, rseg,
diff -r ecc465bb3ec4 -r 5a7cb400776c sys/dev/eisa/dpt_eisa.c
--- a/sys/dev/eisa/dpt_eisa.c Thu Jul 14 01:59:18 2016 +0000
+++ b/sys/dev/eisa/dpt_eisa.c Thu Jul 14 04:00:45 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dpt_eisa.c,v 1.22 2014/03/29 19:28:24 christos Exp $ */
+/* $NetBSD: dpt_eisa.c,v 1.23 2016/07/14 04:00:45 msaitoh Exp $ */
/*
* Copyright (c) 1999, 2000, 2001 Andrew Doran <ad%NetBSD.org@localhost>
@@ -32,7 +32,7 @@
*/
Home |
Main Index |
Thread Index |
Old Index