Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci Remove an extra debug printf(). KNF.
details: https://anonhg.NetBSD.org/src/rev/5b1d5b8b0972
branches: trunk
changeset: 751005:5b1d5b8b0972
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Thu Jan 21 08:52:20 2010 +0000
description:
Remove an extra debug printf(). KNF.
No functional change.
diffstat:
sys/dev/pci/if_wm.c | 501 ++++++++++++++++++++++++++-------------------------
1 files changed, 256 insertions(+), 245 deletions(-)
diffs (truncated from 846 to 300 lines):
diff -r b478e44e863e -r 5b1d5b8b0972 sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c Thu Jan 21 05:32:18 2010 +0000
+++ b/sys/dev/pci/if_wm.c Thu Jan 21 08:52:20 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_wm.c,v 1.193 2010/01/19 22:07:02 pooka Exp $ */
+/* $NetBSD: if_wm.c,v 1.194 2010/01/21 08:52:20 msaitoh Exp $ */
/*
* Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.193 2010/01/19 22:07:02 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.194 2010/01/21 08:52:20 msaitoh Exp $");
#include "rnd.h"
@@ -937,9 +937,9 @@
for (wmp = wm_products; wmp->wmp_name != NULL; wmp++) {
if (PCI_VENDOR(pa->pa_id) == wmp->wmp_vendor &&
PCI_PRODUCT(pa->pa_id) == wmp->wmp_product)
- return (wmp);
- }
- return (NULL);
+ return wmp;
+ }
+ return NULL;
}
static int
@@ -948,9 +948,9 @@
struct pci_attach_args *pa = aux;
if (wm_lookup(pa) != NULL)
- return (1);
-
- return (0);
+ return 1;
+
+ return 0;
}
static void
@@ -1229,8 +1229,7 @@
sizeof(struct wm_control_data_82542) :
sizeof(struct wm_control_data_82544);
if ((error = bus_dmamem_alloc(sc->sc_dmat, cdata_size, PAGE_SIZE,
- (bus_size_t) 0x100000000ULL,
- &seg, 1, &rseg, 0)) != 0) {
+ (bus_size_t) 0x100000000ULL, &seg, 1, &rseg, 0)) != 0) {
aprint_error_dev(sc->sc_dev,
"unable to allocate control data, error = %d\n",
error);
@@ -1238,15 +1237,14 @@
}
if ((error = bus_dmamem_map(sc->sc_dmat, &seg, rseg, cdata_size,
- (void **)&sc->sc_control_data,
- BUS_DMA_COHERENT)) != 0) {
+ (void **)&sc->sc_control_data, BUS_DMA_COHERENT)) != 0) {
aprint_error_dev(sc->sc_dev,
"unable to map control data, error = %d\n", error);
goto fail_1;
}
if ((error = bus_dmamap_create(sc->sc_dmat, cdata_size, 1, cdata_size,
- 0, 0, &sc->sc_cddmamap)) != 0) {
+ 0, 0, &sc->sc_cddmamap)) != 0) {
aprint_error_dev(sc->sc_dev,
"unable to create control data DMA map, error = %d\n",
error);
@@ -1254,8 +1252,7 @@
}
if ((error = bus_dmamap_load(sc->sc_dmat, sc->sc_cddmamap,
- sc->sc_control_data, cdata_size, NULL,
- 0)) != 0) {
+ sc->sc_control_data, cdata_size, NULL, 0)) != 0) {
aprint_error_dev(sc->sc_dev,
"unable to load control data DMA map, error = %d\n",
error);
@@ -1270,8 +1267,8 @@
WM_TXQUEUELEN_MAX_82547 : WM_TXQUEUELEN_MAX;
for (i = 0; i < WM_TXQUEUELEN(sc); i++) {
if ((error = bus_dmamap_create(sc->sc_dmat, WM_MAXTXDMA,
- WM_NTXSEGS, WTX_MAX_LEN, 0, 0,
- &sc->sc_txsoft[i].txs_dmamap)) != 0) {
+ WM_NTXSEGS, WTX_MAX_LEN, 0, 0,
+ &sc->sc_txsoft[i].txs_dmamap)) != 0) {
aprint_error_dev(sc->sc_dev,
"unable to create Tx DMA map %d, error = %d\n",
i, error);
@@ -1284,8 +1281,8 @@
*/
for (i = 0; i < WM_NRXDESC; i++) {
if ((error = bus_dmamap_create(sc->sc_dmat, MCLBYTES, 1,
- MCLBYTES, 0, 0,
- &sc->sc_rxsoft[i].rxs_dmamap)) != 0) {
+ MCLBYTES, 0, 0,
+ &sc->sc_rxsoft[i].rxs_dmamap)) != 0) {
aprint_error_dev(sc->sc_dev,
"unable to create Rx DMA map %d error = %d\n",
i, error);
@@ -1846,7 +1843,7 @@
*/
*fieldsp = 0;
*cmdp = 0;
- return (0);
+ return 0;
}
if ((m0->m_pkthdr.csum_flags &
@@ -1998,7 +1995,7 @@
*cmdp = cmd;
*fieldsp = fields;
- return (0);
+ return 0;
}
static void
@@ -2086,7 +2083,7 @@
/* Just return if already stalled. */
if (sc->sc_txfifo_stall)
- return (1);
+ return 1;
if (sc->sc_mii.mii_media_active & IFM_FDX) {
/* Stall only occurs in half-duplex mode. */
@@ -2096,7 +2093,7 @@
if (len >= WM_82547_PAD_LEN + space) {
sc->sc_txfifo_stall = 1;
callout_schedule(&sc->sc_txfifo_ch, 1);
- return (1);
+ return 1;
}
send_packet:
@@ -2104,7 +2101,7 @@
if (sc->sc_txfifo_head >= sc->sc_txfifo_size)
sc->sc_txfifo_head -= sc->sc_txfifo_size;
- return (0);
+ return 0;
}
/*
@@ -2544,7 +2541,7 @@
wm_start(ifp);
splx(s);
- return (error);
+ return error;
}
/*
@@ -2611,7 +2608,7 @@
wm_start(ifp);
}
- return (handled);
+ return handled;
}
/*
@@ -2970,7 +2967,6 @@
== IFM_1000_T)) {
if ((sc->sc_mii.mii_media_status & IFM_ACTIVE) != 0) {
- printf("XXX link sall wa\n");
delay(200*1000); /* XXX too big */
/* Link stall fix for link up */
@@ -3180,7 +3176,7 @@
delay(10*1000);
/* Must acquire the MDIO ownership before MAC reset */
- switch(sc->sc_type) {
+ switch (sc->sc_type) {
case WM_T_82573:
case WM_T_82574:
case WM_T_82583:
@@ -3291,7 +3287,7 @@
wm_get_cfg_done(sc);
/* reload EEPROM */
- switch(sc->sc_type) {
+ switch (sc->sc_type) {
case WM_T_82542_2_0:
case WM_T_82542_2_1:
case WM_T_82543:
@@ -3728,7 +3724,7 @@
sc->sc_rctl |= RCTL_2k;
} else {
if (sc->sc_type >= WM_T_82543) {
- switch(MCLBYTES) {
+ switch (MCLBYTES) {
case 4096:
sc->sc_rctl |= RCTL_BSEX | RCTL_BSEX_4k;
break;
@@ -3760,7 +3756,7 @@
if (error)
log(LOG_ERR, "%s: interface not running\n",
device_xname(sc->sc_dev));
- return (error);
+ return error;
}
/*
@@ -4030,11 +4026,11 @@
wm_put_swfw_semaphore(sc, SWFW_EEP_SM);
else if (sc->sc_flags & WM_F_EEPROM_SEMAPHORE)
wm_put_swsm_semaphore(sc);
- return (1);
+ return 1;
}
}
- return (0);
+ return 0;
}
/*
@@ -4154,7 +4150,7 @@
delay(2);
}
- return (0);
+ return 0;
}
/*
@@ -4176,9 +4172,9 @@
}
if (usec >= SPI_MAX_RETRIES) {
aprint_error_dev(sc->sc_dev, "EEPROM failed to become ready\n");
- return (1);
- }
- return (0);
+ return 1;
+ }
+ return 0;
}
/*
@@ -4199,7 +4195,7 @@
delay(2);
if (wm_spi_eeprom_ready(sc))
- return (1);
+ return 1;
/* Toggle CS to flush commands. */
CSR_WRITE(sc, WMREG_EECD, reg | EECD_CS);
@@ -4224,7 +4220,7 @@
CSR_WRITE(sc, WMREG_EECD, reg);
delay(2);
- return (0);
+ return 0;
}
#define EEPROM_CHECKSUM 0xBABA
@@ -4341,12 +4337,12 @@
MGETHDR(m, M_DONTWAIT, MT_DATA);
if (m == NULL)
- return (ENOBUFS);
+ return ENOBUFS;
MCLGET(m, M_DONTWAIT);
if ((m->m_flags & M_EXT) == 0) {
m_freem(m);
- return (ENOBUFS);
+ return ENOBUFS;
}
if (rxs->rxs_mbuf != NULL)
@@ -4370,7 +4366,7 @@
WM_INIT_RXDESC(sc, idx);
- return (0);
+ return 0;
}
/*
@@ -4732,7 +4728,7 @@
wm_tbi_set_linkled(sc);
- return (0);
+ return 0;
}
/*
@@ -5170,7 +5166,7 @@
sc->sc_ctrl |= CTRL_FRCSPD | CTRL_FRCFDX;
Home |
Main Index |
Thread Index |
Old Index