]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
IB/hfi1: Define platform_config_table_limits once
authorBart Van Assche <bart.vanassche@sandisk.com>
Tue, 6 Dec 2016 00:48:11 +0000 (16:48 -0800)
committerDoug Ledford <dledford@redhat.com>
Sun, 11 Dec 2016 20:29:42 +0000 (15:29 -0500)
Defining static data structures in a header file is wrong because
this causes the data structure to be instantiated once in every .c
file it is included in. Hence move the definition of a static
array from a header file into the only .c file in which it is used.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Dennis Dalessandro <dennis.dalessandro@intel.com>
Cc: Dean Luick <dean.luick@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hfi1/firmware.c
drivers/infiniband/hw/hfi1/platform.h

index bcf7da4599c48824463ed0430047e34ca107bc6e..0dd50cdb039a0d5969a2b2ea5e8f782bbaffcd16 100644 (file)
@@ -239,6 +239,16 @@ static const u8 all_fabric_serdes_broadcast = 0xe1;
 const u8 pcie_serdes_broadcast[2] = { 0xe2, 0xe3 };
 static const u8 all_pcie_serdes_broadcast = 0xe0;
 
+static const u32 platform_config_table_limits[PLATFORM_CONFIG_TABLE_MAX] = {
+       0,
+       SYSTEM_TABLE_MAX,
+       PORT_TABLE_MAX,
+       RX_PRESET_TABLE_MAX,
+       TX_PRESET_TABLE_MAX,
+       QSFP_ATTEN_TABLE_MAX,
+       VARIABLE_SETTINGS_TABLE_MAX
+};
+
 /* forwards */
 static void dispose_one_firmware(struct firmware_details *fdet);
 static int load_fabric_serdes_firmware(struct hfi1_devdata *dd,
index 31155401a95b76d35fa666a81238031a9c96c199..eed0aa9124fa6f922fbd148cbc0d32a59c3e4635 100644 (file)
@@ -168,16 +168,6 @@ struct platform_config_cache {
        struct platform_config_data config_tables[PLATFORM_CONFIG_TABLE_MAX];
 };
 
-static const u32 platform_config_table_limits[PLATFORM_CONFIG_TABLE_MAX] = {
-       0,
-       SYSTEM_TABLE_MAX,
-       PORT_TABLE_MAX,
-       RX_PRESET_TABLE_MAX,
-       TX_PRESET_TABLE_MAX,
-       QSFP_ATTEN_TABLE_MAX,
-       VARIABLE_SETTINGS_TABLE_MAX
-};
-
 /* This section defines default values and encodings for the
  * fields defined for each table above
  */