Module Name: src Committed By: msaitoh Date: Thu Apr 25 10:44:53 UTC 2019
Modified Files: src/sys/arch/acorn32/eb7500atx: if_cs.c src/sys/dev/ic: rtl80x9.c src/sys/dev/sbus: if_le_ledma.c Log Message: KNF. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/arch/acorn32/eb7500atx/if_cs.c cvs rdiff -u -r1.17 -r1.18 src/sys/dev/ic/rtl80x9.c cvs rdiff -u -r1.35 -r1.36 src/sys/dev/sbus/if_le_ledma.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/acorn32/eb7500atx/if_cs.c diff -u src/sys/arch/acorn32/eb7500atx/if_cs.c:1.11 src/sys/arch/acorn32/eb7500atx/if_cs.c:1.12 --- src/sys/arch/acorn32/eb7500atx/if_cs.c:1.11 Thu Apr 25 10:08:45 2019 +++ src/sys/arch/acorn32/eb7500atx/if_cs.c Thu Apr 25 10:44:53 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_cs.c,v 1.11 2019/04/25 10:08:45 msaitoh Exp $ */ +/* $NetBSD: if_cs.c,v 1.12 2019/04/25 10:44:53 msaitoh Exp $ */ /* * Copyright (c) 2004 Christopher Gilbert @@ -58,7 +58,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_cs.c,v 1.11 2019/04/25 10:08:45 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_cs.c,v 1.12 2019/04/25 10:44:53 msaitoh Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -145,7 +145,7 @@ cs_rsbus_attach(device_t parent, device_ cs_rsbus_bs_tag = *rs->sa_iot; /* Registers are normally accessed in pairs, on a 4 byte aligned */ - cs_rsbus_bs_tag.bs_cookie = (void *) 1; + cs_rsbus_bs_tag.bs_cookie = (void *)1; sc->sc_iot = sc->sc_memt = &cs_rsbus_bs_tag; @@ -195,11 +195,11 @@ cs_rsbus_attach(device_t parent, device_ sc->sc_io_read_1 = cs_rbus_read_1; /* - * also provide media, otherwise it attempts to read the media from + * Also provide media, otherwise it attempts to read the media from * the EEPROM, which again fails */ cs_attach(sc, NULL, cs_rbus_media, __arraycount(cs_rbus_media), - IFM_ETHER |IFM_10_T | IFM_FDX); + IFM_ETHER | IFM_10_T | IFM_FDX); } /* @@ -210,20 +210,18 @@ static uint8_t cs_rbus_read_1(struct cs_softc *sc, bus_size_t a) { bus_size_t offset; - /* - * if it's an even address then just use the bus_space_read_1 - */ + + /* If it's an even address then just use the bus_space_read_1 */ if ((a & 1) == 0) - { return bus_space_read_1(sc->sc_iot, sc->sc_ioh, a); - } + /* - * otherwise we've get to work out the aligned address and then add + * Otherwise we've get to work out the aligned address and then add * one */ offset = (a & ~1) << 1; offset++; - /* and read it, with no shift (cookie is 0) */ + /* And read it, with no shift (cookie is 0) */ return sc->sc_iot->bs_r_1(0, (sc)->sc_ioh, offset); } Index: src/sys/dev/ic/rtl80x9.c diff -u src/sys/dev/ic/rtl80x9.c:1.17 src/sys/dev/ic/rtl80x9.c:1.18 --- src/sys/dev/ic/rtl80x9.c:1.17 Thu Apr 25 10:08:45 2019 +++ src/sys/dev/ic/rtl80x9.c Thu Apr 25 10:44:52 2019 @@ -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 *s /* 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 *s 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 * 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 * 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; Index: src/sys/dev/sbus/if_le_ledma.c diff -u src/sys/dev/sbus/if_le_ledma.c:1.35 src/sys/dev/sbus/if_le_ledma.c:1.36 --- src/sys/dev/sbus/if_le_ledma.c:1.35 Tue Jan 19 22:07:43 2010 +++ src/sys/dev/sbus/if_le_ledma.c Thu Apr 25 10:44:53 2019 @@ -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, * 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 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, st * 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 /* 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 /* 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 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);