Commit e5209263 authored by Johannes Berg's avatar Johannes Berg Committed by Emmanuel Grumbach

iwlwifi: make various things const

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: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent 5045388c
...@@ -109,7 +109,7 @@ extern const struct iwl_dvm_cfg iwl_dvm_6030_cfg; ...@@ -109,7 +109,7 @@ extern const struct iwl_dvm_cfg iwl_dvm_6030_cfg;
struct iwl_ucode_capabilities; 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) static inline void iwl_set_calib_hdr(struct iwl_calib_hdr *hdr, u8 cmd)
{ {
...@@ -480,7 +480,7 @@ do { \ ...@@ -480,7 +480,7 @@ do { \
} while (0) } while (0)
#endif /* CONFIG_IWLWIFI_DEBUG */ #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) static inline const char *iwl_dvm_get_cmd_string(u8 cmd)
{ {
......
...@@ -317,7 +317,7 @@ static const struct iwl_sensitivity_ranges iwl5000_sensitivity = { ...@@ -317,7 +317,7 @@ static const struct iwl_sensitivity_ranges iwl5000_sensitivity = {
.nrg_th_cca = 62, .nrg_th_cca = 62,
}; };
static struct iwl_sensitivity_ranges iwl5150_sensitivity = { static const struct iwl_sensitivity_ranges iwl5150_sensitivity = {
.min_nrg_cck = 95, .min_nrg_cck = 95,
.auto_corr_min_ofdm = 90, .auto_corr_min_ofdm = 90,
.auto_corr_min_ofdm_mrc = 170, .auto_corr_min_ofdm_mrc = 170,
......
...@@ -1564,7 +1564,7 @@ static void iwlagn_mac_sta_notify(struct ieee80211_hw *hw, ...@@ -1564,7 +1564,7 @@ static void iwlagn_mac_sta_notify(struct ieee80211_hw *hw,
IWL_DEBUG_MAC80211(priv, "leave\n"); IWL_DEBUG_MAC80211(priv, "leave\n");
} }
struct ieee80211_ops iwlagn_hw_ops = { const struct ieee80211_ops iwlagn_hw_ops = {
.tx = iwlagn_mac_tx, .tx = iwlagn_mac_tx,
.start = iwlagn_mac_start, .start = iwlagn_mac_start,
.stop = iwlagn_mac_stop, .stop = iwlagn_mac_stop,
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#define IWL_CMD_ENTRY(x) [x] = #x #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_ALIVE),
IWL_CMD_ENTRY(REPLY_ERROR), IWL_CMD_ENTRY(REPLY_ERROR),
IWL_CMD_ENTRY(REPLY_ECHO), IWL_CMD_ENTRY(REPLY_ECHO),
......
...@@ -393,7 +393,7 @@ struct iwl_trans_config { ...@@ -393,7 +393,7 @@ struct iwl_trans_config {
bool rx_buf_size_8k; bool rx_buf_size_8k;
bool bc_table_dword; bool bc_table_dword;
unsigned int queue_watchdog_timeout; unsigned int queue_watchdog_timeout;
const char **command_names; const char *const *command_names;
}; };
struct iwl_trans; struct iwl_trans;
......
...@@ -2233,7 +2233,7 @@ static int iwl_mvm_mac_testmode_cmd(struct ieee80211_hw *hw, ...@@ -2233,7 +2233,7 @@ static int iwl_mvm_mac_testmode_cmd(struct ieee80211_hw *hw,
} }
#endif #endif
struct ieee80211_ops iwl_mvm_hw_ops = { const struct ieee80211_ops iwl_mvm_hw_ops = {
.tx = iwl_mvm_mac_tx, .tx = iwl_mvm_mac_tx,
.ampdu_action = iwl_mvm_mac_ampdu_action, .ampdu_action = iwl_mvm_mac_ampdu_action,
.start = iwl_mvm_mac_start, .start = iwl_mvm_mac_start,
......
...@@ -91,8 +91,7 @@ enum iwl_mvm_tx_fifo { ...@@ -91,8 +91,7 @@ enum iwl_mvm_tx_fifo {
IWL_MVM_TX_FIFO_MCAST = 5, IWL_MVM_TX_FIFO_MCAST = 5,
}; };
extern struct ieee80211_ops iwl_mvm_hw_ops; extern const struct ieee80211_ops iwl_mvm_hw_ops;
extern const struct iwl_mvm_power_ops pm_mac_ops;
/** /**
* struct iwl_mvm_mod_params - module parameters for iwlmvm * struct iwl_mvm_mod_params - module parameters for iwlmvm
......
...@@ -245,7 +245,7 @@ static const struct iwl_rx_handlers iwl_mvm_rx_handlers[] = { ...@@ -245,7 +245,7 @@ static const struct iwl_rx_handlers iwl_mvm_rx_handlers[] = {
#undef RX_HANDLER #undef RX_HANDLER
#define CMD(x) [x] = #x #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(MVM_ALIVE),
CMD(REPLY_ERROR), CMD(REPLY_ERROR),
CMD(INIT_COMPLETE_NOTIF), CMD(INIT_COMPLETE_NOTIF),
......
...@@ -289,8 +289,8 @@ u8 iwl_mvm_next_antenna(struct iwl_mvm *mvm, u8 valid, u8 last_idx) ...@@ -289,8 +289,8 @@ u8 iwl_mvm_next_antenna(struct iwl_mvm *mvm, u8 valid, u8 last_idx)
return last_idx; return last_idx;
} }
static struct { static const struct {
char *name; const char *name;
u8 num; u8 num;
} advanced_lookup[] = { } advanced_lookup[] = {
{ "NMI_INTERRUPT_WDG", 0x34 }, { "NMI_INTERRUPT_WDG", 0x34 },
......
...@@ -304,7 +304,7 @@ struct iwl_trans_pcie { ...@@ -304,7 +304,7 @@ struct iwl_trans_pcie {
bool bc_table_dword; bool bc_table_dword;
u32 rx_page_order; u32 rx_page_order;
const char **command_names; const char *const *command_names;
/* queue watchdog */ /* queue watchdog */
unsigned long wd_timeout; unsigned long wd_timeout;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment