From nobody Sun Feb 12 21:38:15 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFLS81Wx8z3p9lX; Sun, 12 Feb 2023 21:38:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PFLS80zYQz4MLV; Sun, 12 Feb 2023 21:38:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676237896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D6POHTpktpJBdwSi+EzAMq1P9hASuEWTs3FD/OwGh54=; b=pVuOisuCqCho+vJRlaL6LrjT/TIikNJnqtj+I/ZIwPzQb8FeqLelWuHGetP2G4Kq2PBHH5 w+Q8w9MFB/WkKvGvWoSjr84AYCySyqvChMV29Mmdd9fPq0lNpvcekM6tiixD9wNxNgMqDI NfFmug9FGvLUVVWVFxMYIfyQvS5ncRDuqb4U2McfEXe9YW+CKyB2T/nj6nA5R1Gy2vpyJ/ iVqMiwLkVp9XsM7GgLA1daUVOCuY+vzACM3d9d/BVmEnUGaxHLYk7au0p/3SvHcx/I0ljy K/9uiPP2PAWK2sQwM5ZTXMQJSFriv4CK/5rloO2dOlHcwWKXm3Sx3mQJYrvZXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676237896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D6POHTpktpJBdwSi+EzAMq1P9hASuEWTs3FD/OwGh54=; b=kiuUzbJHUBTOLwaOoeGviBC/Dh71isurVSRuLIyuPRMOlWZx6VpkvKsAujBIJBuOxyn4/r ISfn46hhkxcsLLEHIWjmCz+btKoTcTFDaheqAGjFtrZZNMkKpVO7nqMs8y5fXLltHqDbeO wNWhwdPoK9wtsWb7vBhYmQ8mF4E3gGTwlTtaRVB3MXu2nmvWQMhsfROhh/rdq8j2EtklH5 w+oIxhRbQiyQO2ClN9S2tfnHwggdIrM4WRxYZVh/V+ahLutDSZRL49hQrJw1KINyVCQdMZ 7sqlah1XrlEPGs9pO0O5q5gOC64YZIphP5T7fjqfd/ysTsO3LkuxEV6Iv+HM8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676237896; a=rsa-sha256; cv=none; b=lIVz0d1WKGqpkznuCCjQ/YOA5q3iDfEtRJWqJJ+QkO4vglnsCjwi//FC5q5GEBjISc0PzL gPDKLU17+TtNr2HGqZWBJ58bTz/NKNrjb+pHXrw4RwYwKheSGZRwzMPM5F6+OVyj2l0K8B fH1EOsa7w4qcz+VafTNcKAP6eJgTC4J3yx+1MDD+2p3N9yvw9rN5/NxQM6a79SdYQhfPwx ZJU4NWwqBT+5ml9mtXa0XcqKrq5y9g6eYfgA238J5NmLe39o01uguUnBApc7HM6PzFsnGp yI5Xz+ufponTLg/k1e93DwAVnzn5R09eeLfdGjb3q1DQ4XnAr1BnVSqDo6wCQg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFLS76q0pzth0; Sun, 12 Feb 2023 21:38:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31CLcFat041558; Sun, 12 Feb 2023 21:38:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31CLcF5J041557; Sun, 12 Feb 2023 21:38:15 GMT (envelope-from git) Date: Sun, 12 Feb 2023 21:38:15 GMT Message-Id: <202302122138.31CLcF5J041557@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 16d10ee0235a - main - lge: ansify List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 16d10ee0235abb217773aa46b927c8c1513f3261 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=16d10ee0235abb217773aa46b927c8c1513f3261 commit 16d10ee0235abb217773aa46b927c8c1513f3261 Author: Mateusz Guzik AuthorDate: 2023-02-12 21:37:24 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-12 21:38:11 +0000 lge: ansify Reported by: clang 15 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/dev/lge/if_lge.c | 123 ++++++++++++++++----------------------------------- 1 file changed, 37 insertions(+), 86 deletions(-) diff --git a/sys/dev/lge/if_lge.c b/sys/dev/lge/if_lge.c index e977e4e6897c..bbca5dfb77c2 100644 --- a/sys/dev/lge/if_lge.c +++ b/sys/dev/lge/if_lge.c @@ -211,10 +211,7 @@ MODULE_DEPEND(lge, miibus, 1, 1, 1); * Read a word of data stored in the EEPROM at address 'addr.' */ static void -lge_eeprom_getword(sc, addr, dest) - struct lge_softc *sc; - int addr; - u_int16_t *dest; +lge_eeprom_getword(struct lge_softc *sc, int addr, u_int16_t *dest) { int i; u_int32_t val; @@ -245,12 +242,7 @@ lge_eeprom_getword(sc, addr, dest) * Read a sequence of words from the EEPROM. */ static void -lge_read_eeprom(sc, dest, off, cnt, swap) - struct lge_softc *sc; - caddr_t dest; - int off; - int cnt; - int swap; +lge_read_eeprom(struct lge_softc *sc, caddr_t dest, int off, int cnt, int swap) { int i; u_int16_t word = 0, *ptr; @@ -268,9 +260,7 @@ lge_read_eeprom(sc, dest, off, cnt, swap) } static int -lge_miibus_readreg(dev, phy, reg) - device_t dev; - int phy, reg; +lge_miibus_readreg(device_t dev, int phy, int reg) { struct lge_softc *sc; int i; @@ -300,9 +290,7 @@ lge_miibus_readreg(dev, phy, reg) } static int -lge_miibus_writereg(dev, phy, reg, data) - device_t dev; - int phy, reg, data; +lge_miibus_writereg(device_t dev, int phy, int reg, int data) { struct lge_softc *sc; int i; @@ -325,8 +313,7 @@ lge_miibus_writereg(dev, phy, reg, data) } static void -lge_miibus_statchg(dev) - device_t dev; +lge_miibus_statchg(device_t dev) { struct lge_softc *sc; struct mii_data *mii; @@ -379,8 +366,7 @@ lge_hash_maddr(void *arg, struct sockaddr_dl *sdl, u_int count) } static void -lge_setmulti(sc) - struct lge_softc *sc; +lge_setmulti(struct lge_softc *sc) { if_t ifp; uint32_t hashes[2] = { 0, 0 }; @@ -411,8 +397,7 @@ lge_setmulti(sc) } static void -lge_reset(sc) - struct lge_softc *sc; +lge_reset(struct lge_softc *sc) { int i; @@ -429,7 +414,7 @@ lge_reset(sc) /* Wait a little while for the chip to get its brains in order. */ DELAY(1000); - return; + return; } /* @@ -437,8 +422,7 @@ lge_reset(sc) * IDs against our list and return a device name if we find a match. */ static int -lge_probe(dev) - device_t dev; +lge_probe(device_t dev) { const struct lge_type *t; @@ -461,8 +445,7 @@ lge_probe(dev) * setup and ethernet/BPF attach. */ static int -lge_attach(dev) - device_t dev; +lge_attach(device_t dev) { u_char eaddr[ETHER_ADDR_LEN]; struct lge_softc *sc; @@ -471,7 +454,7 @@ lge_attach(dev) sc = device_get_softc(dev); sc->lge_dev = dev; - + mtx_init(&sc->lge_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); callout_init_mtx(&sc->lge_stat_callout, &sc->lge_mtx, 0); @@ -592,8 +575,7 @@ fail: } static int -lge_detach(dev) - device_t dev; +lge_detach(device_t dev) { struct lge_softc *sc; if_t ifp; @@ -627,8 +609,7 @@ lge_detach(dev) * Initialize the transmit descriptors. */ static int -lge_list_tx_init(sc) - struct lge_softc *sc; +lge_list_tx_init(struct lge_softc *sc) { struct lge_list_data *ld; struct lge_ring_data *cd; @@ -653,8 +634,7 @@ lge_list_tx_init(sc) * points back to the first. */ static int -lge_list_rx_init(sc) - struct lge_softc *sc; +lge_list_rx_init(struct lge_softc *sc) { struct lge_list_data *ld; struct lge_ring_data *cd; @@ -684,10 +664,7 @@ lge_list_rx_init(sc) * Initialize an RX descriptor and attach an MBUF cluster. */ static int -lge_newbuf(sc, c, m) - struct lge_softc *sc; - struct lge_rx_desc *c; - struct mbuf *m; +lge_newbuf(struct lge_softc *sc, struct lge_rx_desc *c, struct mbuf *m) { struct mbuf *m_new = NULL; char *buf = NULL; @@ -752,8 +729,7 @@ lge_newbuf(sc, c, m) } static int -lge_alloc_jumbo_mem(sc) - struct lge_softc *sc; +lge_alloc_jumbo_mem(struct lge_softc *sc) { caddr_t ptr; int i; @@ -795,8 +771,7 @@ lge_alloc_jumbo_mem(sc) } static void -lge_free_jumbo_mem(sc) - struct lge_softc *sc; +lge_free_jumbo_mem(struct lge_softc *sc) { struct lge_jpool_entry *entry; @@ -825,13 +800,12 @@ lge_free_jumbo_mem(sc) * Allocate a jumbo buffer. */ static void * -lge_jalloc(sc) - struct lge_softc *sc; +lge_jalloc(struct lge_softc *sc) { struct lge_jpool_entry *entry; - + entry = SLIST_FIRST(&sc->lge_jfree_listhead); - + if (entry == NULL) { #ifdef LGE_VERBOSE device_printf(sc->lge_dev, "no free jumbo buffers\n"); @@ -880,9 +854,7 @@ lge_jfree(struct mbuf *m) * the higher level protocols. */ static void -lge_rxeof(sc, cnt) - struct lge_softc *sc; - int cnt; +lge_rxeof(struct lge_softc *sc, int cnt) { struct mbuf *m; if_t ifp; @@ -964,8 +936,7 @@ lge_rxeof(sc, cnt) } static void -lge_rxeoc(sc) - struct lge_softc *sc; +lge_rxeoc(struct lge_softc *sc) { if_t ifp; @@ -981,8 +952,7 @@ lge_rxeoc(sc) */ static void -lge_txeof(sc) - struct lge_softc *sc; +lge_txeof(struct lge_softc *sc) { struct lge_tx_desc *cur_tx = NULL; if_t ifp; @@ -1024,8 +994,7 @@ lge_txeof(sc) } static void -lge_tick(xsc) - void *xsc; +lge_tick(void *xsc) { struct lge_softc *sc; struct mii_data *mii; @@ -1063,8 +1032,7 @@ lge_tick(xsc) } static void -lge_intr(arg) - void *arg; +lge_intr(void *arg) { struct lge_softc *sc; if_t ifp; @@ -1123,10 +1091,7 @@ lge_intr(arg) * pointers to the fragment pointers. */ static int -lge_encap(sc, m_head, txidx) - struct lge_softc *sc; - struct mbuf *m_head; - u_int32_t *txidx; +lge_encap(struct lge_softc *sc, struct mbuf *m_head, u_int32_t *txidx) { struct lge_frag *f = NULL; struct lge_tx_desc *cur_tx; @@ -1174,8 +1139,7 @@ lge_encap(sc, m_head, txidx) */ static void -lge_start(ifp) - if_t ifp; +lge_start(if_t ifp) { struct lge_softc *sc; @@ -1186,8 +1150,7 @@ lge_start(ifp) } static void -lge_start_locked(ifp) - if_t ifp; +lge_start_locked(if_t ifp) { struct lge_softc *sc; struct mbuf *m_head = NULL; @@ -1235,8 +1198,7 @@ lge_start_locked(ifp) } static void -lge_init(xsc) - void *xsc; +lge_init(void *xsc) { struct lge_softc *sc = xsc; @@ -1246,8 +1208,7 @@ lge_init(xsc) } static void -lge_init_locked(sc) - struct lge_softc *sc; +lge_init_locked(struct lge_softc *sc) { if_t ifp = sc->lge_ifp; @@ -1375,8 +1336,7 @@ lge_init_locked(sc) * Set media options. */ static int -lge_ifmedia_upd(ifp) - if_t ifp; +lge_ifmedia_upd(if_t ifp) { struct lge_softc *sc; @@ -1389,8 +1349,7 @@ lge_ifmedia_upd(ifp) } static void -lge_ifmedia_upd_locked(ifp) - if_t ifp; +lge_ifmedia_upd_locked(if_t ifp) { struct lge_softc *sc; struct mii_data *mii; @@ -1410,9 +1369,7 @@ lge_ifmedia_upd_locked(ifp) * Report current media status. */ static void -lge_ifmedia_sts(ifp, ifmr) - if_t ifp; - struct ifmediareq *ifmr; +lge_ifmedia_sts(if_t ifp, struct ifmediareq *ifmr) { struct lge_softc *sc; struct mii_data *mii; @@ -1430,10 +1387,7 @@ lge_ifmedia_sts(ifp, ifmr) } static int -lge_ioctl(ifp, command, data) - if_t ifp; - u_long command; - caddr_t data; +lge_ioctl(if_t ifp, u_long command, caddr_t data) { struct lge_softc *sc = if_getsoftc(ifp); struct ifreq *ifr = (struct ifreq *) data; @@ -1496,8 +1450,7 @@ lge_ioctl(ifp, command, data) } static void -lge_watchdog(sc) - struct lge_softc *sc; +lge_watchdog(struct lge_softc *sc) { if_t ifp; @@ -1521,8 +1474,7 @@ lge_watchdog(sc) * RX and TX lists. */ static void -lge_stop(sc) - struct lge_softc *sc; +lge_stop(struct lge_softc *sc) { int i; if_t ifp; @@ -1572,8 +1524,7 @@ lge_stop(sc) * get confused by errant DMAs when rebooting. */ static int -lge_shutdown(dev) - device_t dev; +lge_shutdown(device_t dev) { struct lge_softc *sc;