Source-Changes-HG archive

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

[src/trunk]: src/sys/dev constify, and make static where possible



details:   https://anonhg.NetBSD.org/src/rev/e72b2ae49fe2
branches:  trunk
changeset: 972566:e72b2ae49fe2
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sat May 30 13:41:58 2020 +0000

description:
constify, and make static where possible

diffstat:

 sys/dev/ic/bwfm.c            |   8 ++++----
 sys/dev/ic/bwfmvar.h         |  10 +++++-----
 sys/dev/pci/if_bwfm_pci.c    |   8 ++++----
 sys/dev/sdmmc/if_bwfm_sdio.c |   8 ++++----
 4 files changed, 17 insertions(+), 17 deletions(-)

diffs (131 lines):

diff -r cd2ac855ae81 -r e72b2ae49fe2 sys/dev/ic/bwfm.c
--- a/sys/dev/ic/bwfm.c Sat May 30 13:35:31 2020 +0000
+++ b/sys/dev/ic/bwfm.c Sat May 30 13:41:58 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bwfm.c,v 1.22 2020/03/25 04:53:11 thorpej Exp $ */
+/* $NetBSD: bwfm.c,v 1.23 2020/05/30 13:41:58 jdolecek Exp $ */
 /* $OpenBSD: bwfm.c,v 1.5 2017/10/16 22:27:16 patrick Exp $ */
 /*
  * Copyright (c) 2010-2016 Broadcom Corporation
@@ -119,15 +119,15 @@
 void    bwfm_rx_event_cb(struct bwfm_softc *, struct mbuf *);
 void    bwfm_scan_node(struct bwfm_softc *, struct bwfm_bss_info *, size_t);
 
-uint8_t bwfm_2ghz_channels[] = {
+static const uint8_t bwfm_2ghz_channels[] = {
        1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
 };
-uint8_t bwfm_5ghz_channels[] = {
+static const uint8_t bwfm_5ghz_channels[] = {
        34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64, 100, 104, 108, 112,
        116, 120, 124, 128, 132, 136, 140, 144, 149, 153, 157, 161, 165,
 };
 
-struct bwfm_proto_ops bwfm_proto_bcdc_ops = {
+const struct bwfm_proto_ops bwfm_proto_bcdc_ops = {
        .proto_query_dcmd = bwfm_proto_bcdc_query_dcmd,
        .proto_set_dcmd = bwfm_proto_bcdc_set_dcmd,
 };
diff -r cd2ac855ae81 -r e72b2ae49fe2 sys/dev/ic/bwfmvar.h
--- a/sys/dev/ic/bwfmvar.h      Sat May 30 13:35:31 2020 +0000
+++ b/sys/dev/ic/bwfmvar.h      Sat May 30 13:41:58 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bwfmvar.h,v 1.8 2020/03/25 04:53:11 thorpej Exp $ */
+/* $NetBSD: bwfmvar.h,v 1.9 2020/05/30 13:41:58 jdolecek Exp $ */
 /* $OpenBSD: bwfmvar.h,v 1.1 2017/10/11 17:19:50 patrick Exp $ */
 /*
  * Copyright (c) 2010-2016 Broadcom Corporation
@@ -156,7 +156,7 @@
        int (*proto_set_dcmd)(struct bwfm_softc *, int, int,
            char *, size_t);
 };
-extern struct bwfm_proto_ops bwfm_proto_bcdc_ops;
+extern const struct bwfm_proto_ops bwfm_proto_bcdc_ops;
 
 enum bwfm_task_cmd {
        BWFM_TASK_NEWSTATE,
@@ -195,9 +195,9 @@
        struct ethercom          sc_ec;
 #define        sc_if                    sc_ec.ec_if
 
-       struct bwfm_bus_ops     *sc_bus_ops;
-       struct bwfm_buscore_ops *sc_buscore_ops;
-       struct bwfm_proto_ops   *sc_proto_ops;
+       const struct bwfm_bus_ops       *sc_bus_ops;
+       const struct bwfm_buscore_ops   *sc_buscore_ops;
+       const struct bwfm_proto_ops     *sc_proto_ops;
        struct bwfm_chip         sc_chip;
        uint8_t                  sc_io_type;
 #define                BWFM_IO_TYPE_D11N               1
diff -r cd2ac855ae81 -r e72b2ae49fe2 sys/dev/pci/if_bwfm_pci.c
--- a/sys/dev/pci/if_bwfm_pci.c Sat May 30 13:35:31 2020 +0000
+++ b/sys/dev/pci/if_bwfm_pci.c Sat May 30 13:41:58 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bwfm_pci.c,v 1.7 2020/03/25 03:44:45 thorpej Exp $  */
+/*     $NetBSD: if_bwfm_pci.c,v 1.8 2020/05/30 13:41:58 jdolecek Exp $ */
 /*     $OpenBSD: if_bwfm_pci.c,v 1.18 2018/02/08 05:00:38 patrick Exp $        */
 /*
  * Copyright (c) 2010-2016 Broadcom Corporation
@@ -290,7 +290,7 @@
 int             bwfm_pci_msgbuf_set_dcmd(struct bwfm_softc *, int,
                    int, char *, size_t);
 
-struct bwfm_buscore_ops bwfm_pci_buscore_ops = {
+static const struct bwfm_buscore_ops bwfm_pci_buscore_ops = {
        .bc_read = bwfm_pci_buscore_read,
        .bc_write = bwfm_pci_buscore_write,
        .bc_prepare = bwfm_pci_buscore_prepare,
@@ -299,7 +299,7 @@
        .bc_activate = bwfm_pci_buscore_activate,
 };
 
-struct bwfm_bus_ops bwfm_pci_bus_ops = {
+static const struct bwfm_bus_ops bwfm_pci_bus_ops = {
        .bs_init = NULL,
        .bs_stop = bwfm_pci_stop,
        .bs_txcheck = bwfm_pci_txcheck,
@@ -308,7 +308,7 @@
        .bs_rxctl = NULL,
 };
 
-struct bwfm_proto_ops bwfm_pci_msgbuf_ops = {
+static const struct bwfm_proto_ops bwfm_pci_msgbuf_ops = {
        .proto_query_dcmd = bwfm_pci_msgbuf_query_dcmd,
        .proto_set_dcmd = bwfm_pci_msgbuf_set_dcmd,
 };
diff -r cd2ac855ae81 -r e72b2ae49fe2 sys/dev/sdmmc/if_bwfm_sdio.c
--- a/sys/dev/sdmmc/if_bwfm_sdio.c      Sat May 30 13:35:31 2020 +0000
+++ b/sys/dev/sdmmc/if_bwfm_sdio.c      Sat May 30 13:41:58 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bwfm_sdio.c,v 1.16 2020/05/24 17:26:18 riastradh Exp $ */
+/* $NetBSD: if_bwfm_sdio.c,v 1.17 2020/05/30 13:41:58 jdolecek Exp $ */
 /* $OpenBSD: if_bwfm_sdio.c,v 1.1 2017/10/11 17:19:50 patrick Exp $ */
 /*
  * Copyright (c) 2010-2016 Broadcom Corporation
@@ -245,7 +245,7 @@
        BWFM_FW_ENTRY_END
 };
 
-struct bwfm_bus_ops bwfm_sdio_bus_ops = {
+static const struct bwfm_bus_ops bwfm_sdio_bus_ops = {
        .bs_init = NULL,
        .bs_stop = NULL,
        .bs_txcheck = bwfm_sdio_txcheck,
@@ -254,7 +254,7 @@
        .bs_rxctl = bwfm_sdio_rxctl,
 };
 
-struct bwfm_buscore_ops bwfm_sdio_buscore_ops = {
+static const struct bwfm_buscore_ops bwfm_sdio_buscore_ops = {
        .bc_read = bwfm_sdio_buscore_read,
        .bc_write = bwfm_sdio_buscore_write,
        .bc_prepare = bwfm_sdio_buscore_prepare,
@@ -303,7 +303,7 @@
        },
 };
 
-static const char *compatible[] = {
+static const char * const compatible[] = {
        "brcm,bcm4329-fmac",
        NULL
 };



Home | Main Index | Thread Index | Old Index