bnxt: initialize board_info values with proper enums
authorScott Branden <scott.branden@broadcom.com>
Mon, 28 Aug 2017 17:40:29 +0000 (13:40 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Aug 2017 23:57:09 +0000 (16:57 -0700)
initialize board_info values with proper enums for defensive programming
purposes.  This will avoid any errors of the enums being declared not
lining up with the board_info array.

Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c

index 500681da3c161adff1c815bc9ed7e956750e510e..1afb408798d1a242dce11202ad8ab7266c70e1f3 100644 (file)
@@ -114,38 +114,38 @@ enum board_idx {
 static const struct {
        char *name;
 } board_info[] = {
-       { "Broadcom BCM57301 NetXtreme-C 10Gb Ethernet" },
-       { "Broadcom BCM57302 NetXtreme-C 10Gb/25Gb Ethernet" },
-       { "Broadcom BCM57304 NetXtreme-C 10Gb/25Gb/40Gb/50Gb Ethernet" },
-       { "Broadcom BCM57417 NetXtreme-E Ethernet Partition" },
-       { "Broadcom BCM58700 Nitro 1Gb/2.5Gb/10Gb Ethernet" },
-       { "Broadcom BCM57311 NetXtreme-C 10Gb Ethernet" },
-       { "Broadcom BCM57312 NetXtreme-C 10Gb/25Gb Ethernet" },
-       { "Broadcom BCM57402 NetXtreme-E 10Gb Ethernet" },
-       { "Broadcom BCM57404 NetXtreme-E 10Gb/25Gb Ethernet" },
-       { "Broadcom BCM57406 NetXtreme-E 10GBase-T Ethernet" },
-       { "Broadcom BCM57402 NetXtreme-E Ethernet Partition" },
-       { "Broadcom BCM57407 NetXtreme-E 10GBase-T Ethernet" },
-       { "Broadcom BCM57412 NetXtreme-E 10Gb Ethernet" },
-       { "Broadcom BCM57414 NetXtreme-E 10Gb/25Gb Ethernet" },
-       { "Broadcom BCM57416 NetXtreme-E 10GBase-T Ethernet" },
-       { "Broadcom BCM57417 NetXtreme-E 10GBase-T Ethernet" },
-       { "Broadcom BCM57412 NetXtreme-E Ethernet Partition" },
-       { "Broadcom BCM57314 NetXtreme-C 10Gb/25Gb/40Gb/50Gb Ethernet" },
-       { "Broadcom BCM57417 NetXtreme-E 10Gb/25Gb Ethernet" },
-       { "Broadcom BCM57416 NetXtreme-E 10Gb Ethernet" },
-       { "Broadcom BCM57404 NetXtreme-E Ethernet Partition" },
-       { "Broadcom BCM57406 NetXtreme-E Ethernet Partition" },
-       { "Broadcom BCM57407 NetXtreme-E 25Gb Ethernet" },
-       { "Broadcom BCM57407 NetXtreme-E Ethernet Partition" },
-       { "Broadcom BCM57414 NetXtreme-E Ethernet Partition" },
-       { "Broadcom BCM57416 NetXtreme-E Ethernet Partition" },
-       { "Broadcom BCM57452 NetXtreme-E 10Gb/25Gb/40Gb/50Gb Ethernet" },
-       { "Broadcom BCM57454 NetXtreme-E 10Gb/25Gb/40Gb/50Gb/100Gb Ethernet" },
-       { "Broadcom BCM58802 NetXtreme-S 10Gb/25Gb/40Gb/50Gb Ethernet" },
-       { "Broadcom BCM58808 NetXtreme-S 10Gb/25Gb/40Gb/50Gb/100Gb Ethernet" },
-       { "Broadcom NetXtreme-E Ethernet Virtual Function" },
-       { "Broadcom NetXtreme-C Ethernet Virtual Function" },
+       [BCM57301] = { "Broadcom BCM57301 NetXtreme-C 10Gb Ethernet" },
+       [BCM57302] = { "Broadcom BCM57302 NetXtreme-C 10Gb/25Gb Ethernet" },
+       [BCM57304] = { "Broadcom BCM57304 NetXtreme-C 10Gb/25Gb/40Gb/50Gb Ethernet" },
+       [BCM57417_NPAR] = { "Broadcom BCM57417 NetXtreme-E Ethernet Partition" },
+       [BCM58700] = { "Broadcom BCM58700 Nitro 1Gb/2.5Gb/10Gb Ethernet" },
+       [BCM57311] = { "Broadcom BCM57311 NetXtreme-C 10Gb Ethernet" },
+       [BCM57312] = { "Broadcom BCM57312 NetXtreme-C 10Gb/25Gb Ethernet" },
+       [BCM57402] = { "Broadcom BCM57402 NetXtreme-E 10Gb Ethernet" },
+       [BCM57404] = { "Broadcom BCM57404 NetXtreme-E 10Gb/25Gb Ethernet" },
+       [BCM57406] = { "Broadcom BCM57406 NetXtreme-E 10GBase-T Ethernet" },
+       [BCM57402_NPAR] = { "Broadcom BCM57402 NetXtreme-E Ethernet Partition" },
+       [BCM57407] = { "Broadcom BCM57407 NetXtreme-E 10GBase-T Ethernet" },
+       [BCM57412] = { "Broadcom BCM57412 NetXtreme-E 10Gb Ethernet" },
+       [BCM57414] = { "Broadcom BCM57414 NetXtreme-E 10Gb/25Gb Ethernet" },
+       [BCM57416] = { "Broadcom BCM57416 NetXtreme-E 10GBase-T Ethernet" },
+       [BCM57417] = { "Broadcom BCM57417 NetXtreme-E 10GBase-T Ethernet" },
+       [BCM57412_NPAR] = { "Broadcom BCM57412 NetXtreme-E Ethernet Partition" },
+       [BCM57314] = { "Broadcom BCM57314 NetXtreme-C 10Gb/25Gb/40Gb/50Gb Ethernet" },
+       [BCM57417_SFP] = { "Broadcom BCM57417 NetXtreme-E 10Gb/25Gb Ethernet" },
+       [BCM57416_SFP] = { "Broadcom BCM57416 NetXtreme-E 10Gb Ethernet" },
+       [BCM57404_NPAR] = { "Broadcom BCM57404 NetXtreme-E Ethernet Partition" },
+       [BCM57406_NPAR] = { "Broadcom BCM57406 NetXtreme-E Ethernet Partition" },
+       [BCM57407_SFP] = { "Broadcom BCM57407 NetXtreme-E 25Gb Ethernet" },
+       [BCM57407_NPAR] = { "Broadcom BCM57407 NetXtreme-E Ethernet Partition" },
+       [BCM57414_NPAR] = { "Broadcom BCM57414 NetXtreme-E Ethernet Partition" },
+       [BCM57416_NPAR] = { "Broadcom BCM57416 NetXtreme-E Ethernet Partition" },
+       [BCM57452] = { "Broadcom BCM57452 NetXtreme-E 10Gb/25Gb/40Gb/50Gb Ethernet" },
+       [BCM57454] = { "Broadcom BCM57454 NetXtreme-E 10Gb/25Gb/40Gb/50Gb/100Gb Ethernet" },
+       [BCM58802] = { "Broadcom BCM58802 NetXtreme-S 10Gb/25Gb/40Gb/50Gb Ethernet" },
+       [BCM58808] = { "Broadcom BCM58808 NetXtreme-S 10Gb/25Gb/40Gb/50Gb/100Gb Ethernet" },
+       [NETXTREME_E_VF] = { "Broadcom NetXtreme-E Ethernet Virtual Function" },
+       [NETXTREME_C_VF] = { "Broadcom NetXtreme-C Ethernet Virtual Function" },
 };
 
 static const struct pci_device_id bnxt_pci_tbl[] = {