iwlwifi: make various things const
authorJohannes Berg <johannes.berg@intel.com>
Mon, 20 Jan 2014 22:38:59 +0000 (23:38 +0100)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Thu, 13 Feb 2014 08:18:43 +0000 (10:18 +0200)
There are a number of things in the .data section that should
really be in .rodata, for example all ops structs and strings.
Mark everything const that can be, leaving the .data section
pretty much empty.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/dvm/agn.h
drivers/net/wireless/iwlwifi/dvm/devices.c
drivers/net/wireless/iwlwifi/dvm/mac80211.c
drivers/net/wireless/iwlwifi/dvm/rx.c
drivers/net/wireless/iwlwifi/iwl-trans.h
drivers/net/wireless/iwlwifi/mvm/mac80211.c
drivers/net/wireless/iwlwifi/mvm/mvm.h
drivers/net/wireless/iwlwifi/mvm/ops.c
drivers/net/wireless/iwlwifi/mvm/utils.c
drivers/net/wireless/iwlwifi/pcie/internal.h

index 562772d851021e390575868ece4f3fbf04068ede..c160dad03037bd01399a8747096a3653ee67cd3a 100644 (file)
@@ -109,7 +109,7 @@ extern const struct iwl_dvm_cfg iwl_dvm_6030_cfg;
 
 struct iwl_ucode_capabilities;
 
-extern struct ieee80211_ops iwlagn_hw_ops;
+extern const struct ieee80211_ops iwlagn_hw_ops;
 
 static inline void iwl_set_calib_hdr(struct iwl_calib_hdr *hdr, u8 cmd)
 {
@@ -480,7 +480,7 @@ do {                                                                        \
 } while (0)
 #endif                         /* CONFIG_IWLWIFI_DEBUG */
 
-extern const char *iwl_dvm_cmd_strings[REPLY_MAX];
+extern const char *const iwl_dvm_cmd_strings[REPLY_MAX];
 
 static inline const char *iwl_dvm_get_cmd_string(u8 cmd)
 {
index 7b140e487deb8da42a19d669e4428830516470c6..758c54eeb206718f8077aa2686304ea1a1e4c9bb 100644 (file)
@@ -317,7 +317,7 @@ static const struct iwl_sensitivity_ranges iwl5000_sensitivity = {
        .nrg_th_cca = 62,
 };
 
-static struct iwl_sensitivity_ranges iwl5150_sensitivity = {
+static const struct iwl_sensitivity_ranges iwl5150_sensitivity = {
        .min_nrg_cck = 95,
        .auto_corr_min_ofdm = 90,
        .auto_corr_min_ofdm_mrc = 170,
index c24d1d3d55f66a470d3e62663348e79eb729997f..f57608943ca6860870520877e63d8288a9c29243 100644 (file)
@@ -1564,7 +1564,7 @@ static void iwlagn_mac_sta_notify(struct ieee80211_hw *hw,
        IWL_DEBUG_MAC80211(priv, "leave\n");
 }
 
-struct ieee80211_ops iwlagn_hw_ops = {
+const struct ieee80211_ops iwlagn_hw_ops = {
        .tx = iwlagn_mac_tx,
        .start = iwlagn_mac_start,
        .stop = iwlagn_mac_stop,
index 7a1bc1c547e17ea3e35c47b1070c174c9268c9d6..cd8377346aff0c2936a6f0ee773ae8fd33042025 100644 (file)
@@ -39,7 +39,7 @@
 
 #define IWL_CMD_ENTRY(x) [x] = #x
 
-const char *iwl_dvm_cmd_strings[REPLY_MAX] = {
+const char *const iwl_dvm_cmd_strings[REPLY_MAX] = {
        IWL_CMD_ENTRY(REPLY_ALIVE),
        IWL_CMD_ENTRY(REPLY_ERROR),
        IWL_CMD_ENTRY(REPLY_ECHO),
index 7b19274b550f2bef5c0dbb9c5b4d4d933dc81d5e..8cdb0dd618a6fdfcc8d57095e41974e6e22984ab 100644 (file)
@@ -393,7 +393,7 @@ struct iwl_trans_config {
        bool rx_buf_size_8k;
        bool bc_table_dword;
        unsigned int queue_watchdog_timeout;
-       const char **command_names;
+       const char *const *command_names;
 };
 
 struct iwl_trans;
index ba4dcabf7c4a508924a239c5db4aaa35bfb62b9b..42f70469e73be956fff7902442b49426c1414109 100644 (file)
@@ -2233,7 +2233,7 @@ static int iwl_mvm_mac_testmode_cmd(struct ieee80211_hw *hw,
 }
 #endif
 
-struct ieee80211_ops iwl_mvm_hw_ops = {
+const struct ieee80211_ops iwl_mvm_hw_ops = {
        .tx = iwl_mvm_mac_tx,
        .ampdu_action = iwl_mvm_mac_ampdu_action,
        .start = iwl_mvm_mac_start,
index ebea5f2e274150802a1ee19e1a51978ba9ef30a0..bde8190bb6c4f85d89253b9836e0fc2cb8e5c238 100644 (file)
@@ -91,8 +91,7 @@ enum iwl_mvm_tx_fifo {
        IWL_MVM_TX_FIFO_MCAST = 5,
 };
 
-extern struct ieee80211_ops iwl_mvm_hw_ops;
-extern const struct iwl_mvm_power_ops pm_mac_ops;
+extern const struct ieee80211_ops iwl_mvm_hw_ops;
 
 /**
  * struct iwl_mvm_mod_params - module parameters for iwlmvm
index a46f0b8b0870aa6b506dd26a20161fcd540d0c67..ae347fb16a5d74d1b7e7b1409e65875e98efd47d 100644 (file)
@@ -245,7 +245,7 @@ static const struct iwl_rx_handlers iwl_mvm_rx_handlers[] = {
 #undef RX_HANDLER
 #define CMD(x) [x] = #x
 
-static const char *iwl_mvm_cmd_strings[REPLY_MAX] = {
+static const char *const iwl_mvm_cmd_strings[REPLY_MAX] = {
        CMD(MVM_ALIVE),
        CMD(REPLY_ERROR),
        CMD(INIT_COMPLETE_NOTIF),
index f4598cb2dd2e8922f9c598b360d89c64351bf29e..2021b57189bc20fc5fc61c40b0514fbfae32ce59 100644 (file)
@@ -289,8 +289,8 @@ u8 iwl_mvm_next_antenna(struct iwl_mvm *mvm, u8 valid, u8 last_idx)
        return last_idx;
 }
 
-static struct {
-       char *name;
+static const struct {
+       const char *name;
        u8 num;
 } advanced_lookup[] = {
        { "NMI_INTERRUPT_WDG", 0x34 },
index e851f26fd44c1644c81b24f9a91b690ab2fb418e..3120bc5bb12d76331f387c23a2bb479384ed818f 100644 (file)
@@ -304,7 +304,7 @@ struct iwl_trans_pcie {
        bool bc_table_dword;
        u32 rx_page_order;
 
-       const char **command_names;
+       const char *const *command_names;
 
        /* queue watchdog */
        unsigned long wd_timeout;