Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb Localify, constify.



details:   https://anonhg.NetBSD.org/src/rev/e7cd3a867ecc
branches:  trunk
changeset: 968215:e7cd3a867ecc
user:      maxv <maxv%NetBSD.org@localhost>
date:      Tue Jan 07 06:42:26 2020 +0000

description:
Localify, constify.

diffstat:

 sys/dev/usb/if_aue.c    |  14 ++++++------
 sys/dev/usb/if_axe.c    |  14 ++++++------
 sys/dev/usb/if_axen.c   |   6 ++--
 sys/dev/usb/if_cdce.c   |   6 ++--
 sys/dev/usb/if_cue.c    |  16 +++++++-------
 sys/dev/usb/if_kue.c    |  18 ++++++++--------
 sys/dev/usb/if_mos.c    |   8 +++---
 sys/dev/usb/if_mue.c    |   8 +++---
 sys/dev/usb/if_smsc.c   |  55 ++++++++++++++++++++++++------------------------
 sys/dev/usb/if_udav.c   |  14 ++++++------
 sys/dev/usb/if_upl.c    |  16 +++++++-------
 sys/dev/usb/if_ure.c    |   6 ++--
 sys/dev/usb/if_url.c    |  14 ++++++------
 sys/dev/usb/if_urndis.c |   6 ++--
 sys/dev/usb/u3g.c       |   6 ++--
 sys/dev/usb/uark.c      |   6 ++--
 sys/dev/usb/ubsa.c      |   6 ++--
 sys/dev/usb/uchcom.c    |   6 ++--
 sys/dev/usb/uftdi.c     |   6 ++--
 sys/dev/usb/uhub.c      |  24 ++++++++++----------
 sys/dev/usb/uipad.c     |  18 +++++++--------
 sys/dev/usb/uipaq.c     |  22 +++++++++---------
 sys/dev/usb/ukyopon.c   |   6 ++--
 sys/dev/usb/umcs.c      |   6 ++--
 sys/dev/usb/umct.c      |   6 ++--
 sys/dev/usb/umodem.c    |   6 ++--
 sys/dev/usb/uplcom.c    |  22 +++++++++---------
 sys/dev/usb/usbnet.h    |   4 +-
 sys/dev/usb/uvisor.c    |   6 ++--
 29 files changed, 174 insertions(+), 177 deletions(-)

diffs (truncated from 1361 to 300 lines):

diff -r 98c156e1da7a -r e7cd3a867ecc sys/dev/usb/if_aue.c
--- a/sys/dev/usb/if_aue.c      Tue Jan 07 06:14:42 2020 +0000
+++ b/sys/dev/usb/if_aue.c      Tue Jan 07 06:42:26 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_aue.c,v 1.161 2019/08/23 04:34:51 mrg Exp $ */
+/*     $NetBSD: if_aue.c,v 1.162 2020/01/07 06:42:26 maxv Exp $        */
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.161 2019/08/23 04:34:51 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.162 2020/01/07 06:42:26 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -231,8 +231,8 @@
 };
 #define aue_lookup(v, p) ((const struct aue_type *)usb_lookup(aue_devs, v, p))
 
-int aue_match(device_t, cfdata_t, void *);
-void aue_attach(device_t, device_t, void *);
+static int aue_match(device_t, cfdata_t, void *);
+static void aue_attach(device_t, device_t, void *);
 
 CFATTACH_DECL_NEW(aue, sizeof(struct aue_softc), aue_match, aue_attach,
     usbnet_detach, usbnet_activate);
@@ -250,7 +250,7 @@
 static int aue_init(struct ifnet *);
 static void aue_intr(struct usbnet *, usbd_status);
 
-static struct usbnet_ops aue_ops = {
+static const struct usbnet_ops aue_ops = {
        .uno_stop = aue_stop_cb,
        .uno_ioctl = aue_ioctl_cb,
        .uno_read_reg = aue_mii_read_reg,
@@ -742,7 +742,7 @@
 /*
  * Probe for a Pegasus chip.
  */
-int
+static int
 aue_match(device_t parent, cfdata_t match, void *aux)
 {
        struct usb_attach_arg *uaa = aux;
@@ -775,7 +775,7 @@
  * Attach the interface. Allocate softc structures, do ifmedia
  * setup and ethernet/BPF attach.
  */
-void
+static void
 aue_attach(device_t parent, device_t self, void *aux)
 {
        USBNET_MII_DECL_DEFAULT(unm);
diff -r 98c156e1da7a -r e7cd3a867ecc sys/dev/usb/if_axe.c
--- a/sys/dev/usb/if_axe.c      Tue Jan 07 06:14:42 2020 +0000
+++ b/sys/dev/usb/if_axe.c      Tue Jan 07 06:42:26 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_axe.c,v 1.120 2019/08/26 17:26:33 rin Exp $ */
+/*     $NetBSD: if_axe.c,v 1.121 2020/01/07 06:42:26 maxv Exp $        */
 /*     $OpenBSD: if_axe.c,v 1.137 2016/04/13 11:03:37 mpi Exp $ */
 
 /*
@@ -87,7 +87,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.120 2019/08/26 17:26:33 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.121 2020/01/07 06:42:26 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -250,8 +250,8 @@
        { 0x8700, 0x8A3D, 32768 }
 };
 
-int    axe_match(device_t, cfdata_t, void *);
-void   axe_attach(device_t, device_t, void *);
+static int     axe_match(device_t, cfdata_t, void *);
+static void    axe_attach(device_t, device_t, void *);
 
 CFATTACH_DECL_NEW(axe, sizeof(struct axe_softc),
        axe_match, axe_attach, usbnet_detach, usbnet_activate);
@@ -271,7 +271,7 @@
 static void    axe_ax88772a_init(struct axe_softc *);
 static void    axe_ax88772b_init(struct axe_softc *);
 
-static struct usbnet_ops axe_ops = {
+static const struct usbnet_ops axe_ops = {
        .uno_stop = axe_stop,
        .uno_ioctl = axe_ioctl,
        .uno_read_reg = axe_mii_read_reg,
@@ -846,7 +846,7 @@
 /*
  * Probe for a AX88172 chip.
  */
-int
+static int
 axe_match(device_t parent, cfdata_t match, void *aux)
 {
        struct usb_attach_arg *uaa = aux;
@@ -859,7 +859,7 @@
  * Attach the interface. Allocate softc structures, do ifmedia
  * setup and ethernet/BPF attach.
  */
-void
+static void
 axe_attach(device_t parent, device_t self, void *aux)
 {
        AXEHIST_FUNC(); AXEHIST_CALLED();
diff -r 98c156e1da7a -r e7cd3a867ecc sys/dev/usb/if_axen.c
--- a/sys/dev/usb/if_axen.c     Tue Jan 07 06:14:42 2020 +0000
+++ b/sys/dev/usb/if_axen.c     Tue Jan 07 06:42:26 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_axen.c,v 1.67 2019/08/23 04:32:57 mrg Exp $ */
+/*     $NetBSD: if_axen.c,v 1.68 2020/01/07 06:42:26 maxv Exp $        */
 /*     $OpenBSD: if_axen.c,v 1.3 2013/10/21 10:10:22 yuo Exp $ */
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.67 2019/08/23 04:32:57 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.68 2020/01/07 06:42:26 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -88,7 +88,7 @@
                                struct usbnet_chain *);
 static int     axen_init(struct ifnet *);
 
-static struct usbnet_ops axen_ops = {
+static const struct usbnet_ops axen_ops = {
        .uno_stop = axen_stop_cb,
        .uno_ioctl = axen_ioctl_cb,
        .uno_read_reg = axen_mii_read_reg,
diff -r 98c156e1da7a -r e7cd3a867ecc sys/dev/usb/if_cdce.c
--- a/sys/dev/usb/if_cdce.c     Tue Jan 07 06:14:42 2020 +0000
+++ b/sys/dev/usb/if_cdce.c     Tue Jan 07 06:42:26 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_cdce.c,v 1.67 2019/08/20 06:37:06 mrg Exp $ */
+/*     $NetBSD: if_cdce.c,v 1.68 2020/01/07 06:42:26 maxv Exp $ */
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul <wpaul%windriver.com@localhost>
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.67 2019/08/20 06:37:06 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.68 2020/01/07 06:42:26 maxv Exp $");
 
 #include <sys/param.h>
 
@@ -83,7 +83,7 @@
                                struct usbnet_chain *);
 static int     cdce_init(struct ifnet *);
 
-static struct usbnet_ops cdce_ops = {
+static const struct usbnet_ops cdce_ops = {
        .uno_tx_prepare = cdce_tx_prepare,
        .uno_rx_loop = cdce_rx_loop,
        .uno_init = cdce_init,
diff -r 98c156e1da7a -r e7cd3a867ecc sys/dev/usb/if_cue.c
--- a/sys/dev/usb/if_cue.c      Tue Jan 07 06:14:42 2020 +0000
+++ b/sys/dev/usb/if_cue.c      Tue Jan 07 06:42:26 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_cue.c,v 1.87 2019/12/27 09:41:51 msaitoh Exp $      */
+/*     $NetBSD: if_cue.c,v 1.88 2020/01/07 06:42:26 maxv Exp $ */
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
@@ -57,7 +57,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_cue.c,v 1.87 2019/12/27 09:41:51 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cue.c,v 1.88 2020/01/07 06:42:26 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -124,7 +124,7 @@
 /*
  * Various supported device vendors/products.
  */
-static struct usb_devno cue_devs[] = {
+static const struct usb_devno cue_devs[] = {
        { USB_VENDOR_CATC, USB_PRODUCT_CATC_NETMATE },
        { USB_VENDOR_CATC, USB_PRODUCT_CATC_NETMATE2 },
        { USB_VENDOR_SMARTBRIDGES, USB_PRODUCT_SMARTBRIDGES_SMARTLINK },
@@ -132,8 +132,8 @@
 };
 #define cue_lookup(v, p) (usb_lookup(cue_devs, v, p))
 
-int cue_match(device_t, cfdata_t, void *);
-void cue_attach(device_t, device_t, void *);
+static int cue_match(device_t, cfdata_t, void *);
+static void cue_attach(device_t, device_t, void *);
 
 CFATTACH_DECL_NEW(cue, sizeof(struct cue_softc), cue_match, cue_attach,
     usbnet_detach, usbnet_activate);
@@ -146,7 +146,7 @@
 static int cue_init(struct ifnet *);
 static void cue_tick(struct usbnet *);
 
-static struct usbnet_ops cue_ops = {
+static const struct usbnet_ops cue_ops = {
        .uno_stop = cue_stop_cb,
        .uno_ioctl = cue_ioctl_cb,
        .uno_tx_prepare = cue_tx_prepare,
@@ -443,7 +443,7 @@
 /*
  * Probe for a CATC chip.
  */
-int
+static int
 cue_match(device_t parent, cfdata_t match, void *aux)
 {
        struct usb_attach_arg *uaa = aux;
@@ -456,7 +456,7 @@
  * Attach the interface. Allocate softc structures, do ifmedia
  * setup and ethernet/BPF attach.
  */
-void
+static void
 cue_attach(device_t parent, device_t self, void *aux)
 {
        struct cue_softc *sc = device_private(self);
diff -r 98c156e1da7a -r e7cd3a867ecc sys/dev/usb/if_kue.c
--- a/sys/dev/usb/if_kue.c      Tue Jan 07 06:14:42 2020 +0000
+++ b/sys/dev/usb/if_kue.c      Tue Jan 07 06:42:26 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_kue.c,v 1.100 2019/08/20 06:37:06 mrg Exp $ */
+/*     $NetBSD: if_kue.c,v 1.101 2020/01/07 06:42:26 maxv Exp $        */
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.100 2019/08/20 06:37:06 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.101 2020/01/07 06:42:26 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -164,9 +164,9 @@
 };
 #define kue_lookup(v, p) (usb_lookup(kue_devs, v, p))
 
-int kue_match(device_t, cfdata_t, void *);
-void kue_attach(device_t, device_t, void *);
-int kue_detach(device_t, int);
+static int kue_match(device_t, cfdata_t, void *);
+static void kue_attach(device_t, device_t, void *);
+static int kue_detach(device_t, int);
 
 CFATTACH_DECL_NEW(kue, sizeof(struct kue_softc), kue_match, kue_attach,
     kue_detach, usbnet_activate);
@@ -177,7 +177,7 @@
 static int kue_ioctl_cb(struct ifnet *, u_long, void *);
 static int kue_init(struct ifnet *);
 
-static struct usbnet_ops kue_ops = {
+static const struct usbnet_ops kue_ops = {
        .uno_ioctl = kue_ioctl_cb,
        .uno_tx_prepare = kue_tx_prepare,
        .uno_rx_loop = kue_rx_loop,
@@ -395,7 +395,7 @@
 /*
  * Probe for a KLSI chip.
  */
-int
+static int
 kue_match(device_t parent, cfdata_t match, void *aux)
 {
        struct usb_attach_arg *uaa = aux;
@@ -410,7 +410,7 @@
  * Attach the interface. Allocate softc structures, do
  * setup and ethernet/BPF attach.
  */
-void
+static void
 kue_attach(device_t parent, device_t self, void *aux)
 {
        struct kue_softc *sc = device_private(self);
@@ -513,7 +513,7 @@
            0, NULL);
 }
 
-int
+static int
 kue_detach(device_t self, int flags)
 {
        struct kue_softc *sc = device_private(self);
diff -r 98c156e1da7a -r e7cd3a867ecc sys/dev/usb/if_mos.c
--- a/sys/dev/usb/if_mos.c      Tue Jan 07 06:14:42 2020 +0000



Home | Main Index | Thread Index | Old Index