git: 16d10ee0235a - main - lge: ansify

From: Mateusz Guzik <mjg_at_FreeBSD.org>
Date: Sun, 12 Feb 2023 21:38:15 UTC
The branch main has been updated by mjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=16d10ee0235abb217773aa46b927c8c1513f3261

commit 16d10ee0235abb217773aa46b927c8c1513f3261
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2023-02-12 21:37:24 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
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;