summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authormsaitoh <msaitoh@NetBSD.org>2019-04-25 10:44:52 +0000
committermsaitoh <msaitoh@NetBSD.org>2019-04-25 10:44:52 +0000
commit9e16cf64d3ece2681a33b8a5eae341bc7edf7d08 (patch)
tree96c40c746da6f27df2db850ade124864d4c33372 /sys/dev
parentea20c19bec2534495931321f7846abd1ca0146a2 (diff)
KNF. No functional change.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/rtl80x9.c24
-rw-r--r--sys/dev/sbus/if_le_ledma.c34
2 files changed, 28 insertions, 30 deletions
diff --git a/sys/dev/ic/rtl80x9.c b/sys/dev/ic/rtl80x9.c
index 3f2b82e8017..0f89f8c6a1b 100644
--- a/sys/dev/ic/rtl80x9.c
+++ b/sys/dev/ic/rtl80x9.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rtl80x9.c,v 1.17 2019/04/25 10:08:45 msaitoh Exp $ */
+/* $NetBSD: rtl80x9.c,v 1.18 2019/04/25 10:44:52 msaitoh Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtl80x9.c,v 1.17 2019/04/25 10:08:45 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtl80x9.c,v 1.18 2019/04/25 10:44:52 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -114,11 +114,11 @@ rtl80x9_init_card(struct dp8390_softc *sc)
/* Write enable config1-3. */
NIC_PUT(sc->sc_regt, sc->sc_regh, NERTL_RTL3_EECR,
- RTL3_EECR_EEM1|RTL3_EECR_EEM0);
+ RTL3_EECR_EEM1 | RTL3_EECR_EEM0);
/* First, set basic media type. */
reg = NIC_GET(sc->sc_regt, sc->sc_regh, NERTL_RTL3_CONFIG2);
- reg &= ~(RTL3_CONFIG2_PL1|RTL3_CONFIG2_PL0);
+ reg &= ~(RTL3_CONFIG2_PL1 | RTL3_CONFIG2_PL0);
switch (IFM_SUBTYPE(ifm->ifm_cur->ifm_media)) {
case IFM_AUTO:
/* Nothing to do; both bits clear == auto-detect. */
@@ -133,7 +133,7 @@ rtl80x9_init_card(struct dp8390_softc *sc)
break;
case IFM_10_2:
- reg |= RTL3_CONFIG2_PL1|RTL3_CONFIG2_PL0;
+ reg |= RTL3_CONFIG2_PL1 | RTL3_CONFIG2_PL0;
break;
}
NIC_PUT(sc->sc_regt, sc->sc_regh, NERTL_RTL3_CONFIG2, reg);
@@ -159,7 +159,7 @@ rtl80x9_media_init(struct dp8390_softc *sc)
static int rtl80x9_media[] = {
IFM_ETHER | IFM_AUTO,
IFM_ETHER | IFM_10_T,
- IFM_ETHER | IFM_10_T|IFM_FDX,
+ IFM_ETHER | IFM_10_T | IFM_FDX,
IFM_ETHER | IFM_10_2,
};
static const int rtl80x9_nmedia = __arraycount(rtl80x9_media);
@@ -176,26 +176,26 @@ rtl80x9_media_init(struct dp8390_softc *sc)
conf3 = bus_space_read_1(sc->sc_regt, sc->sc_regh, NERTL_RTL3_CONFIG3);
printf("[0x%02x 0x%02x] ", conf2, conf3);
- conf2 &= RTL3_CONFIG2_PL1|RTL3_CONFIG2_PL0;
+ conf2 &= RTL3_CONFIG2_PL1 | RTL3_CONFIG2_PL0;
switch (conf2) {
default:
- defmedia = IFM_ETHER|IFM_AUTO;
+ defmedia = IFM_ETHER | IFM_AUTO;
printf("auto\n");
break;
- case RTL3_CONFIG2_PL1|RTL3_CONFIG2_PL0:
+ case RTL3_CONFIG2_PL1 | RTL3_CONFIG2_PL0:
case RTL3_CONFIG2_PL1: /* XXX rtl docs sys 10base5, but chip cant do */
- defmedia = IFM_ETHER|IFM_10_2;
+ defmedia = IFM_ETHER | IFM_10_2;
printf("10base2\n");
break;
case RTL3_CONFIG2_PL0:
if (conf3 & RTL3_CONFIG3_FUDUP) {
- defmedia = IFM_ETHER|IFM_10_T|IFM_FDX;
+ defmedia = IFM_ETHER | IFM_10_T | IFM_FDX;
printf("10baseT-FDX\n");
} else {
- defmedia = IFM_ETHER|IFM_10_T;
+ defmedia = IFM_ETHER | IFM_10_T;
printf("10baseT\n");
}
break;
diff --git a/sys/dev/sbus/if_le_ledma.c b/sys/dev/sbus/if_le_ledma.c
index 057455f522d..c3169aea1f3 100644
--- a/sys/dev/sbus/if_le_ledma.c
+++ b/sys/dev/sbus/if_le_ledma.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_le_ledma.c,v 1.35 2010/01/19 22:07:43 pooka Exp $ */
+/* $NetBSD: if_le_ledma.c,v 1.36 2019/04/25 10:44:53 msaitoh Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_le_ledma.c,v 1.35 2010/01/19 22:07:43 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_le_ledma.c,v 1.36 2019/04/25 10:44:53 msaitoh Exp $");
#include "opt_inet.h"
@@ -95,9 +95,9 @@ void leattach_ledma(device_t, device_t, void *);
* Media types supported by the Sun4m.
*/
static int lemedia[] = {
- IFM_ETHER|IFM_10_T,
- IFM_ETHER|IFM_10_5,
- IFM_ETHER|IFM_AUTO,
+ IFM_ETHER | IFM_10_T,
+ IFM_ETHER | IFM_10_5,
+ IFM_ETHER | IFM_AUTO,
};
#define NLEMEDIA __arraycount(lemedia)
@@ -148,7 +148,7 @@ lerdcsr(struct lance_softc *sc, uint16_t port)
bus_space_handle_t h = lesc->sc_reg;
bus_space_write_2(t, h, LEREG1_RAP, port);
- return (bus_space_read_2(t, h, LEREG1_RDP));
+ return bus_space_read_2(t, h, LEREG1_RDP);
}
void
@@ -181,7 +181,7 @@ lemediachange(struct lance_softc *sc)
struct ifmedia *ifm = &sc->sc_media;
if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER)
- return (EINVAL);
+ return EINVAL;
/*
* Switch to the selected media. If autoselect is
@@ -202,10 +202,10 @@ lemediachange(struct lance_softc *sc)
break;
default:
- return (EINVAL);
+ return EINVAL;
}
- return (0);
+ return 0;
}
void
@@ -217,9 +217,9 @@ lemediastatus(struct lance_softc *sc, struct ifmediareq *ifmr)
* Notify the world which media we're currently using.
*/
if (L64854_GCSR(dma) & E_TP_AUI)
- ifmr->ifm_active = IFM_ETHER|IFM_10_T;
+ ifmr->ifm_active = IFM_ETHER | IFM_10_T;
else
- ifmr->ifm_active = IFM_ETHER|IFM_10_5;
+ ifmr->ifm_active = IFM_ETHER | IFM_10_5;
}
static void
@@ -351,23 +351,21 @@ leattach_ledma(device_t parent, device_t self, void *aux)
/* Get a DMA handle */
if ((error = bus_dmamap_create(dmatag, MEMSIZE, 1, MEMSIZE,
- LEDMA_BOUNDARY, BUS_DMA_NOWAIT,
- &lesc->sc_dmamap)) != 0) {
+ LEDMA_BOUNDARY, BUS_DMA_NOWAIT, &lesc->sc_dmamap)) != 0) {
aprint_error(": DMA map create error %d\n", error);
return;
}
/* Allocate DMA buffer */
if ((error = bus_dmamem_alloc(dmatag, MEMSIZE, 0, LEDMA_BOUNDARY,
- &seg, 1, &rseg, BUS_DMA_NOWAIT)) != 0) {
+ &seg, 1, &rseg, BUS_DMA_NOWAIT)) != 0) {
aprint_error(": DMA buffer alloc error %d\n",error);
return;
}
/* Map DMA buffer into kernel space */
if ((error = bus_dmamem_map(dmatag, &seg, rseg, MEMSIZE,
- (void **)&sc->sc_mem,
- BUS_DMA_NOWAIT|BUS_DMA_COHERENT)) != 0) {
+ (void **)&sc->sc_mem, BUS_DMA_NOWAIT | BUS_DMA_COHERENT)) != 0) {
aprint_error(": DMA buffer map error %d\n", error);
bus_dmamem_free(dmatag, &seg, rseg);
return;
@@ -375,7 +373,7 @@ leattach_ledma(device_t parent, device_t self, void *aux)
/* Load DMA buffer */
if ((error = bus_dmamap_load(dmatag, lesc->sc_dmamap, sc->sc_mem,
- MEMSIZE, NULL, BUS_DMA_NOWAIT|BUS_DMA_COHERENT)) != 0) {
+ MEMSIZE, NULL, BUS_DMA_NOWAIT | BUS_DMA_COHERENT)) != 0) {
aprint_error(": DMA buffer map load error %d\n", error);
bus_dmamem_free(dmatag, &seg, rseg);
bus_dmamem_unmap(dmatag, sc->sc_mem, MEMSIZE);
@@ -391,7 +389,7 @@ leattach_ledma(device_t parent, device_t self, void *aux)
sc->sc_mediastatus = lemediastatus;
sc->sc_supmedia = lemedia;
sc->sc_nsupmedia = NLEMEDIA;
- sc->sc_defaultmedia = IFM_ETHER|IFM_AUTO;
+ sc->sc_defaultmedia = IFM_ETHER | IFM_AUTO;
prom_getether(sa->sa_node, sc->sc_enaddr);