iwlwifi: move config structs to C file
authorJohannes Berg <johannes.berg@intel.com>
Mon, 10 Dec 2018 08:04:55 +0000 (09:04 +0100)
committerLuca Coelho <luciano.coelho@intel.com>
Mon, 4 Feb 2019 10:28:06 +0000 (12:28 +0200)
Even if they're static const, there's no need to duplicate
the structs every time they're included and used. Move them
to an appropriate C file instead.

Also remove useless parentheses along the way.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/iwl-config.h
drivers/net/wireless/intel/iwlwifi/iwl-io.c

index ff942532fac35a56851e82ea2572820e788290d9..f1e4933807133b084a0c24800bc7527e0cbf6d8f 100644 (file)
@@ -445,35 +445,8 @@ struct iwl_cfg {
        u32 d3_debug_data_length;
 };
 
-static const struct iwl_csr_params iwl_csr_v1 = {
-       .flag_mac_clock_ready = 0,
-       .flag_val_mac_access_en = 0,
-       .flag_init_done = 2,
-       .flag_mac_access_req = 3,
-       .flag_sw_reset = 7,
-       .flag_master_dis = 8,
-       .flag_stop_master = 9,
-       .addr_sw_reset = (CSR_BASE + 0x020),
-       .mac_addr0_otp = 0x380,
-       .mac_addr1_otp = 0x384,
-       .mac_addr0_strap = 0x388,
-       .mac_addr1_strap = 0x38C
-};
-
-static const struct iwl_csr_params iwl_csr_v2 = {
-       .flag_init_done = 6,
-       .flag_mac_clock_ready = 20,
-       .flag_val_mac_access_en = 20,
-       .flag_mac_access_req = 21,
-       .flag_master_dis = 28,
-       .flag_stop_master = 29,
-       .flag_sw_reset = 31,
-       .addr_sw_reset = (CSR_BASE + 0x024),
-       .mac_addr0_otp = 0x30,
-       .mac_addr1_otp = 0x34,
-       .mac_addr0_strap = 0x38,
-       .mac_addr1_strap = 0x3C
-};
+extern const struct iwl_csr_params iwl_csr_v1;
+extern const struct iwl_csr_params iwl_csr_v2;
 
 /*
  * This list declares the config structures for all devices.
index ffd1e649bfa08375ef4e921dfe0c7b896302b23d..d62eb2d9389a9785f2c41983394940c67042cac7 100644 (file)
@@ -7,6 +7,7 @@
  *
  * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved.
  * Copyright(c) 2015 - 2016 Intel Deutschland GmbH
+ * Copyright (C) 2018 Intel Corporation
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -28,6 +29,7 @@
  *
  * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved.
  * Copyright(c) 2015 - 2016 Intel Deutschland GmbH
+ * Copyright (C) 2018 Intel Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 #include "iwl-prph.h"
 #include "iwl-fh.h"
 
+const struct iwl_csr_params iwl_csr_v1 = {
+       .flag_mac_clock_ready = 0,
+       .flag_val_mac_access_en = 0,
+       .flag_init_done = 2,
+       .flag_mac_access_req = 3,
+       .flag_sw_reset = 7,
+       .flag_master_dis = 8,
+       .flag_stop_master = 9,
+       .addr_sw_reset = CSR_BASE + 0x020,
+       .mac_addr0_otp = 0x380,
+       .mac_addr1_otp = 0x384,
+       .mac_addr0_strap = 0x388,
+       .mac_addr1_strap = 0x38C
+};
+
+const struct iwl_csr_params iwl_csr_v2 = {
+       .flag_init_done = 6,
+       .flag_mac_clock_ready = 20,
+       .flag_val_mac_access_en = 20,
+       .flag_mac_access_req = 21,
+       .flag_master_dis = 28,
+       .flag_stop_master = 29,
+       .flag_sw_reset = 31,
+       .addr_sw_reset = CSR_BASE + 0x024,
+       .mac_addr0_otp = 0x30,
+       .mac_addr1_otp = 0x34,
+       .mac_addr0_strap = 0x38,
+       .mac_addr1_strap = 0x3C
+};
+
 void iwl_write8(struct iwl_trans *trans, u32 ofs, u8 val)
 {
        trace_iwlwifi_dev_iowrite8(trans->dev, ofs, val);