Rename 'ifaceidx' variables and parameters to 'ifaceno'. More
authorkrw <krw@openbsd.org>
Fri, 6 Oct 2023 16:06:11 +0000 (16:06 +0000)
committerkrw <krw@openbsd.org>
Fri, 6 Oct 2023 16:06:11 +0000 (16:06 +0000)
consistent with existing code and thus less cnance for confusion.

requested by kettenis@

sys/dev/usb/ucom.c
sys/dev/usb/usb_subr.c

index 7b1fcf4..336d3a3 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ucom.c,v 1.77 2023/10/02 23:38:11 krw Exp $ */
+/*     $OpenBSD: ucom.c,v 1.78 2023/10/06 16:06:11 krw Exp $ */
 /*     $NetBSD: ucom.c,v 1.49 2003/01/01 00:10:25 thorpej Exp $        */
 
 /*
@@ -1256,7 +1256,7 @@ sysctl_ucominit(void)
        int rslt;
        unsigned int unit;
        uint32_t route;
-       uint8_t bus, ifaceidx;
+       uint8_t bus, ifaceno;
 
        KERNEL_ASSERT_LOCKED();
 
@@ -1272,11 +1272,11 @@ sysctl_ucominit(void)
                        if (sc == NULL || sc->sc_iface == NULL)
                                continue;
                        if (usbd_get_location(sc->sc_uparent, sc->sc_iface,
-                           &bus, &route, &ifaceidx) == -1)
+                           &bus, &route, &ifaceno) == -1)
                                continue;
                        rslt = snprintf(name, sizeof(name),
                            "%s:usb%u.%u.%05x.%u,", sc->sc_dev.dv_xname, bus,
-                           ROUTEROOTPORT(route), ROUTESTRING(route), ifaceidx);
+                           ROUTEROOTPORT(route), ROUTESTRING(route), ifaceno);
                        if (rslt < sizeof(name) && (strlen(ucoms) + rslt) <
                            ucomslen)
                                strlcat(ucoms, name, ucomslen);
index ca8d79c..60997d7 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: usb_subr.c,v 1.161 2023/10/02 23:38:11 krw Exp $ */
+/*     $OpenBSD: usb_subr.c,v 1.162 2023/10/06 16:06:11 krw Exp $ */
 /*     $NetBSD: usb_subr.c,v 1.103 2003/01/10 11:19:13 augustss Exp $  */
 /*     $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $   */
 
@@ -1362,7 +1362,7 @@ usbd_get_routestring(struct usbd_device *dev, uint32_t *route)
 
 int
 usbd_get_location(struct usbd_device *dev, struct usbd_interface *iface,
-    uint8_t *bus, uint32_t *route, uint8_t *ifaceidx)
+    uint8_t *bus, uint32_t *route, uint8_t *ifaceno)
 {
        int i;
        uint32_t r;
@@ -1380,7 +1380,7 @@ usbd_get_location(struct usbd_device *dev, struct usbd_interface *iface,
                if (iface == &dev->ifaces[i]) {
                        *bus = dev->bus->usbctl->dv_unit;
                        *route = (usbd_get_routestring(dev, &r)) ? 0 : r;
-                       *ifaceidx = i;
+                       *ifaceno = i;
                        return 0;
                }
        }