Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys - Use aprint*() more in xxx_attach().
details: https://anonhg.NetBSD.org/src/rev/aa750ec29a39
branches: trunk
changeset: 346471:aa750ec29a39
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Thu Jul 14 10:19:05 2016 +0000
description:
- Use aprint*() more in xxx_attach().
- Add missing aprint_naive("\n").
- Remove extra spaces and tabs.
- KNF.
diffstat:
sys/arch/i386/pci/glxsb.c | 31 +++++++++--------
sys/arch/i386/pnpbios/lpt_pnpbios.c | 11 +++--
sys/arch/i386/pnpbios/wss_pnpbios.c | 32 +++++++++---------
sys/arch/i386/pnpbios/ym_pnpbios.c | 40 +++++++++++-----------
sys/dev/ata/ata_raid.c | 7 ++-
sys/dev/audio.c | 30 ++++++++---------
sys/dev/cardbus/adv_cardbus.c | 23 ++++++------
sys/dev/cardbus/if_ral_cardbus.c | 12 ++----
sys/dev/cardbus/if_tlp_cardbus.c | 25 ++++++--------
sys/dev/eisa/cac_eisa.c | 21 +++++------
sys/dev/eisa/if_fea.c | 8 ++--
sys/dev/eisa/mlx_eisa.c | 18 +++++-----
sys/dev/ic/i82586.c | 10 ++---
sys/dev/ic/interwave.c | 17 +++++----
sys/dev/ic/mlx.c | 13 +++----
sys/dev/ic/opl.c | 29 ++++++++--------
sys/dev/ic/pckbc.c | 12 +++---
sys/dev/ir/cir.c | 7 ++-
sys/dev/isa/dpt_isa.c | 15 ++++----
sys/dev/isa/ess.c | 12 ++++--
sys/dev/isa/i82365_isa.c | 11 +++--
sys/dev/isa/if_ep_isa.c | 10 ++--
sys/dev/isa/if_iy.c | 51 ++++++++++++++++------------
sys/dev/isa/if_ntwoc_isa.c | 11 +++--
sys/dev/isa/if_tr_isa.c | 8 ++--
sys/dev/isa/isic_isa.c | 5 +-
sys/dev/isa/mcd.c | 33 +++++++++++-------
sys/dev/isa/mpu_isa.c | 8 ++-
sys/dev/isa/rtfps.c | 9 ++--
sys/dev/isa/seagate.c | 10 +++--
sys/dev/isa/spkr.c | 9 ++--
sys/dev/isa/tcic2_isa.c | 30 +++++++++-------
sys/dev/isa/wt.c | 10 ++--
sys/dev/isapnp/aha_isapnp.c | 16 ++++----
sys/dev/isapnp/gus_isapnp.c | 10 ++--
sys/dev/isapnp/i82365_isapnp.c | 22 ++++++------
sys/dev/isapnp/if_ep_isapnp.c | 10 ++--
sys/dev/isapnp/if_tr_isapnp.c | 14 ++++----
sys/dev/mca/edc_mca.c | 20 +++++-----
sys/dev/mca/esp_mca.c | 6 +-
sys/dev/mca/mca.c | 9 ++--
sys/dev/midi.c | 64 ++++++++++++++++++------------------
sys/dev/pci/bktr/bktr_os.c | 20 ++++++-----
sys/dev/pci/ibmcd.c | 5 +-
sys/dev/pci/if_ntwoc_pci.c | 15 ++++----
sys/dev/pci/if_sip.c | 52 +++++++++++++++---------------
sys/dev/pci/if_txp.c | 8 ++--
sys/dev/pci/isic_pci.c | 19 ++++++----
sys/dev/pci/iwic_pci.c | 13 ++++--
sys/dev/pci/jmide.c | 7 ++-
sys/dev/pci/njs_pci.c | 6 +-
sys/dev/pci/pwdog.c | 5 +-
sys/dev/pci/sv.c | 19 +++++-----
sys/dev/pci/wcfb.c | 50 ++++++++++++++--------------
sys/dev/scsipi/ses.c | 7 ++-
55 files changed, 510 insertions(+), 465 deletions(-)
diffs (truncated from 3543 to 300 lines):
diff -r 05933a6b5c1f -r aa750ec29a39 sys/arch/i386/pci/glxsb.c
--- a/sys/arch/i386/pci/glxsb.c Thu Jul 14 10:02:43 2016 +0000
+++ b/sys/arch/i386/pci/glxsb.c Thu Jul 14 10:19:05 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: glxsb.c,v 1.13 2015/04/13 16:21:54 riastradh Exp $ */
+/* $NetBSD: glxsb.c,v 1.14 2016/07/14 10:19:05 msaitoh Exp $ */
/* $OpenBSD: glxsb.c,v 1.7 2007/02/12 14:31:45 tom Exp $ */
/*
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: glxsb.c,v 1.13 2015/04/13 16:21:54 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: glxsb.c,v 1.14 2016/07/14 10:19:05 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -215,7 +215,8 @@
msr = rdmsr(SB_GLD_MSR_CAP);
if ((msr & 0xFFFF00) != 0x130400) {
- printf(": unknown ID 0x%x\n", (int) ((msr & 0xFFFF00) >> 16));
+ aprint_error(": unknown ID 0x%x\n",
+ (int)((msr & 0xFFFF00) >> 16));
return;
}
@@ -225,7 +226,7 @@
if (pci_mapreg_map(pa, PCI_MAPREG_START,
PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT, 0,
&sc->sc_iot, &sc->sc_ioh, &membase, &memsize)) {
- printf(": can't find mem space\n");
+ aprint_error(": can't find mem space\n");
return;
}
@@ -559,8 +560,8 @@
cuio_copyback((struct uio *)crp->crp_buf,
crd->crd_skip + offset, len, op_dst);
else
- memcpy((char *)crp->crp_buf + crd->crd_skip + offset, op_dst,
- len);
+ memcpy((char *)crp->crp_buf + crd->crd_skip + offset,
+ op_dst, len);
offset += len;
tlen -= len;
@@ -578,7 +579,8 @@
* time.
*/
if (crd->crd_flags & CRD_F_ENCRYPT) {
- memcpy(piv, op_dst + len - sizeof(op_iv), sizeof(op_iv));
+ memcpy(piv, op_dst + len - sizeof(op_iv),
+ sizeof(op_iv));
} else {
/* Decryption, only need this if another iteration */
if (tlen > 0) {
@@ -609,8 +611,8 @@
rc = bus_dmamap_create(sc->sc_dmat, size, dma->dma_nsegs, size,
0, BUS_DMA_NOWAIT, &dma->dma_map);
if (rc != 0) {
- aprint_error_dev(sc->sc_dev, "couldn't create DMA map for %d bytes (%d)\n",
- size, rc);
+ aprint_error_dev(sc->sc_dev,
+ "couldn't create DMA map for %d bytes (%d)\n", size, rc);
goto fail0;
}
@@ -618,7 +620,8 @@
rc = bus_dmamem_alloc(sc->sc_dmat, size, SB_AES_ALIGN, 0,
&dma->dma_seg, dma->dma_nsegs, &dma->dma_nsegs, BUS_DMA_NOWAIT);
if (rc != 0) {
- aprint_error_dev(sc->sc_dev, "couldn't allocate DMA memory of %d bytes (%d)\n",
+ aprint_error_dev(sc->sc_dev,
+ "couldn't allocate DMA memory of %d bytes (%d)\n",
size, rc);
goto fail1;
@@ -627,8 +630,8 @@
rc = bus_dmamem_map(sc->sc_dmat, &dma->dma_seg, 1, size,
&dma->dma_vaddr, BUS_DMA_NOWAIT);
if (rc != 0) {
- aprint_error_dev(sc->sc_dev, "couldn't map DMA memory for %d bytes (%d)\n",
- size, rc);
+ aprint_error_dev(sc->sc_dev,
+ "couldn't map DMA memory for %d bytes (%d)\n", size, rc);
goto fail2;
}
@@ -636,8 +639,8 @@
rc = bus_dmamap_load(sc->sc_dmat, dma->dma_map, dma->dma_vaddr,
size, NULL, BUS_DMA_NOWAIT);
if (rc != 0) {
- aprint_error_dev(sc->sc_dev, "couldn't load DMA memory for %d bytes (%d)\n",
- size, rc);
+ aprint_error_dev(sc->sc_dev,
+ "couldn't load DMA memory for %d bytes (%d)\n", size, rc);
goto fail3;
}
diff -r 05933a6b5c1f -r aa750ec29a39 sys/arch/i386/pnpbios/lpt_pnpbios.c
--- a/sys/arch/i386/pnpbios/lpt_pnpbios.c Thu Jul 14 10:02:43 2016 +0000
+++ b/sys/arch/i386/pnpbios/lpt_pnpbios.c Thu Jul 14 10:19:05 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lpt_pnpbios.c,v 1.12 2011/07/01 18:14:15 dyoung Exp $ */
+/* $NetBSD: lpt_pnpbios.c,v 1.13 2016/07/14 10:19:05 msaitoh Exp $ */
/*
* Copyright (c) 1999
* Matthias Drochner. All rights reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lpt_pnpbios.c,v 1.12 2011/07/01 18:14:15 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lpt_pnpbios.c,v 1.13 2016/07/14 10:19:05 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -77,12 +77,13 @@
sc->sc_dev = self;
- if (pnpbios_io_map(aa->pbt, aa->resc, 0, &sc->sc_iot, &sc->sc_ioh)) {
- printf(": can't map i/o space\n");
+ aprint_naive("\n");
+ if (pnpbios_io_map(aa->pbt, aa->resc, 0, &sc->sc_iot, &sc->sc_ioh)) {
+ aprint_error(": can't map i/o space\n");
return;
}
- printf("\n");
+ aprint_normal("\n");
pnpbios_print_devres(self, aa);
lpt_attach_subr(sc);
diff -r 05933a6b5c1f -r aa750ec29a39 sys/arch/i386/pnpbios/wss_pnpbios.c
--- a/sys/arch/i386/pnpbios/wss_pnpbios.c Thu Jul 14 10:02:43 2016 +0000
+++ b/sys/arch/i386/pnpbios/wss_pnpbios.c Thu Jul 14 10:19:05 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wss_pnpbios.c,v 1.20 2011/07/01 18:14:15 dyoung Exp $ */
+/* $NetBSD: wss_pnpbios.c,v 1.21 2016/07/14 10:19:05 msaitoh Exp $ */
/*
* Copyright (c) 1999
* Matthias Drochner. All rights reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wss_pnpbios.c,v 1.20 2011/07/01 18:14:15 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wss_pnpbios.c,v 1.21 2016/07/14 10:19:05 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -88,20 +88,18 @@
}
int
-wss_pnpbios_match(device_t parent,
- cfdata_t match, void *aux)
+wss_pnpbios_match(device_t parent, cfdata_t match, void *aux)
{
struct pnpbiosdev_attach_args *aa = aux;
if (wss_pnpbios_hints_index(aa->idstr) == -1)
- return (0);
+ return 0;
- return (2); /* beat sb */
+ return 2; /* beat sb */
}
void
-wss_pnpbios_attach(device_t parent, device_t self,
- void *aux)
+wss_pnpbios_attach(device_t parent, device_t self, void *aux)
{
struct wss_softc *sc = device_private(self);
struct pnpbiosdev_attach_args *aa = aux;
@@ -115,16 +113,17 @@
static u_char dma_bits[4] = {1, 2, 0, 3};
#endif
+ aprint_naive("\n");
wph = &wss_pnpbios_hints[wss_pnpbios_hints_index(aa->idstr)];
if (pnpbios_io_map(aa->pbt, aa->resc, wph->io_region_idx_ad1848,
&sc->sc_iot, &sc->sc_ioh)) {
- printf(": can't map i/o space\n");
+ aprint_error(": can't map i/o space\n");
return;
}
if (pnpbios_io_map(aa->pbt, aa->resc, wph->io_region_idx_opl,
&sc->sc_iot, &sc->sc_opl_ioh)) {
- printf(": can't map i/o space\n");
+ aprint_error(": can't map i/o space\n");
return;
}
@@ -132,16 +131,16 @@
sc->wss_ic = aa->ic;
if (pnpbios_getirqnum(aa->pbt, aa->resc, 0, &sc->wss_irq, NULL)) {
- printf(": can't get IRQ\n");
+ aprint_error(": can't get IRQ\n");
return;
}
if (pnpbios_getdmachan(aa->pbt, aa->resc, 0, &sc->wss_playdrq)) {
- printf(": can't get DMA channel\n");
+ aprint_error(": can't get DMA channel\n");
return;
}
if (pnpbios_getdmachan(aa->pbt, aa->resc, 1, &sc->wss_recdrq)) {
- printf(": can't get recording DMA channel");
+ aprint_error(": can't get recording DMA channel");
sc->wss_recdrq = sc->wss_playdrq;
}
@@ -149,10 +148,11 @@
bus_space_subregion(sc->sc_iot, sc->sc_ioh, wph->offset_ad1848, 4,
&sc->sc_ad1848.sc_ad1848.sc_ioh);
- printf("\n");
+ aprint_normal("\n");
pnpbios_print_devres(self, aa);
- printf("%s", device_xname(self));
+ aprint_naive("%s", device_xname(self));
+ aprint_normal("%s", device_xname(self));
if (!ad1848_isa_probe(&sc->sc_ad1848)) {
aprint_error_dev(self, "ad1848 probe failed\n");
@@ -163,7 +163,7 @@
#if 0
/* XXX recdrq */
bus_space_write_1(sc->sc_iot, sc->sc_ioh, WSS_CONFIG,
- (interrupt_bits[sc->wss_irq] | dma_bits[sc->wss_playdrq]));
+ (interrupt_bits[sc->wss_irq] | dma_bits[sc->wss_playdrq]));
#endif
arg.type = AUDIODEV_TYPE_OPL;
arg.hwif = 0;
diff -r 05933a6b5c1f -r aa750ec29a39 sys/arch/i386/pnpbios/ym_pnpbios.c
--- a/sys/arch/i386/pnpbios/ym_pnpbios.c Thu Jul 14 10:02:43 2016 +0000
+++ b/sys/arch/i386/pnpbios/ym_pnpbios.c Thu Jul 14 10:19:05 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ym_pnpbios.c,v 1.17 2011/07/01 18:14:15 dyoung Exp $ */
+/* $NetBSD: ym_pnpbios.c,v 1.18 2016/07/14 10:19:05 msaitoh Exp $ */
/*
* Copyright (c) 1999
* Matthias Drochner. All rights reserved.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ym_pnpbios.c,v 1.17 2011/07/01 18:14:15 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ym_pnpbios.c,v 1.18 2016/07/14 10:19:05 msaitoh Exp $");
#include "mpu_ym.h"
@@ -51,12 +51,12 @@
#include <i386/pnpbios/pnpbiosvar.h>
-#include <dev/ic/ad1848reg.h>
+#include <dev/ic/ad1848reg.h>
#include <dev/isa/ad1848var.h>
-
+
#include <dev/ic/cs4231reg.h>
#include <dev/isa/cs4231var.h>
-
+
#include <dev/ic/opl3sa3reg.h>
#include <dev/isa/wssreg.h>
#include <dev/isa/ymvar.h>
@@ -68,8 +68,7 @@
ym_pnpbios_match, ym_pnpbios_attach, NULL, NULL);
int
-ym_pnpbios_match(device_t parent,
- cfdata_t match, void *aux)
+ym_pnpbios_match(device_t parent, cfdata_t match, void *aux)
{
struct pnpbiosdev_attach_args *aa = aux;
@@ -80,8 +79,7 @@
}
void
-ym_pnpbios_attach(device_t parent, device_t self,
- void *aux)
+ym_pnpbios_attach(device_t parent, device_t self, void *aux)
{
struct ym_softc *sc = device_private(self);
struct ad1848_softc *ac = &sc->sc_ad1848.sc_ad1848;
@@ -89,56 +87,58 @@
ac->sc_dev = self;
Home |
Main Index |
Thread Index |
Old Index