Module Name:    src
Committed By:   jdolecek
Date:           Sat May 30 13:41:58 UTC 2020

Modified Files:
        src/sys/dev/ic: bwfm.c bwfmvar.h
        src/sys/dev/pci: if_bwfm_pci.c
        src/sys/dev/sdmmc: if_bwfm_sdio.c

Log Message:
constify, and make static where possible


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/ic/bwfm.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/ic/bwfmvar.h
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/if_bwfm_pci.c
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/sdmmc/if_bwfm_sdio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/bwfm.c
diff -u src/sys/dev/ic/bwfm.c:1.22 src/sys/dev/ic/bwfm.c:1.23
--- src/sys/dev/ic/bwfm.c:1.22	Wed Mar 25 04:53:11 2020
+++ src/sys/dev/ic/bwfm.c	Sat May 30 13:41:58 2020
@@ -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(struct bwfm_softc *,
 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,
 };

Index: src/sys/dev/ic/bwfmvar.h
diff -u src/sys/dev/ic/bwfmvar.h:1.8 src/sys/dev/ic/bwfmvar.h:1.9
--- src/sys/dev/ic/bwfmvar.h:1.8	Wed Mar 25 04:53:11 2020
+++ src/sys/dev/ic/bwfmvar.h	Sat May 30 13:41:58 2020
@@ -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 @@ struct bwfm_proto_ops {
 	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 bwfm_softc {
 	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

Index: src/sys/dev/pci/if_bwfm_pci.c
diff -u src/sys/dev/pci/if_bwfm_pci.c:1.7 src/sys/dev/pci/if_bwfm_pci.c:1.8
--- src/sys/dev/pci/if_bwfm_pci.c:1.7	Wed Mar 25 03:44:45 2020
+++ src/sys/dev/pci/if_bwfm_pci.c	Sat May 30 13:41:58 2020
@@ -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_query_dcmd(struct 
 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 @@ struct bwfm_buscore_ops bwfm_pci_buscore
 	.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 @@ struct bwfm_bus_ops bwfm_pci_bus_ops = {
 	.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,
 };

Index: src/sys/dev/sdmmc/if_bwfm_sdio.c
diff -u src/sys/dev/sdmmc/if_bwfm_sdio.c:1.16 src/sys/dev/sdmmc/if_bwfm_sdio.c:1.17
--- src/sys/dev/sdmmc/if_bwfm_sdio.c:1.16	Sun May 24 17:26:18 2020
+++ src/sys/dev/sdmmc/if_bwfm_sdio.c	Sat May 30 13:41:58 2020
@@ -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 @@ static const struct bwfm_firmware_select
 	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 @@ struct bwfm_bus_ops bwfm_sdio_bus_ops = 
 	.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 struct bwfm_sdio_product {
 	},
 };
 
-static const char *compatible[] = {
+static const char * const compatible[] = {
 	"brcm,bcm4329-fmac",
 	NULL
 };

Reply via email to