mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 02:24:24 +02:00
wifi: rtlwifi: Constify struct rtl_hal_ops and rtl_hal_cfg
'struct rtl_hal_ops' and 'struct rtl_hal_cfg' are not modified in these drivers. Constifying this structure moves some data to a read-only section, so increase overall security, especially when the structure holds some function pointers. Constification of rtl_hal_cfg is only needed in rtl8192cu/sw.c On a x86_64, with allmodconfig, as an example: Before: ====== text data bss dec hex filename 10167 5512 128 15807 3dbf drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.o After: ===== text data bss dec hex filename 10743 4936 128 15807 3dbf drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.o Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/2c3f3d8d8b2f7dcb8cc64cebe89e55720d1d733d.1747500351.git.christophe.jaillet@wanadoo.fr
This commit is contained in:
parent
1b98f357da
commit
4c95423b6f
|
|
@ -190,7 +190,7 @@ static bool rtl88e_get_btc_status(void)
|
|||
return false;
|
||||
}
|
||||
|
||||
static struct rtl_hal_ops rtl8188ee_hal_ops = {
|
||||
static const struct rtl_hal_ops rtl8188ee_hal_ops = {
|
||||
.init_sw_vars = rtl88e_init_sw_vars,
|
||||
.deinit_sw_vars = rtl88e_deinit_sw_vars,
|
||||
.read_eeprom_info = rtl88ee_read_eeprom_info,
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ static void rtl92c_deinit_sw_vars(struct ieee80211_hw *hw)
|
|||
}
|
||||
}
|
||||
|
||||
static struct rtl_hal_ops rtl8192ce_hal_ops = {
|
||||
static const struct rtl_hal_ops rtl8192ce_hal_ops = {
|
||||
.init_sw_vars = rtl92c_init_sw_vars,
|
||||
.deinit_sw_vars = rtl92c_deinit_sw_vars,
|
||||
.read_eeprom_info = rtl92ce_read_eeprom_info,
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ static bool rtl92cu_get_btc_status(void)
|
|||
return false;
|
||||
}
|
||||
|
||||
static struct rtl_hal_ops rtl8192cu_hal_ops = {
|
||||
static const struct rtl_hal_ops rtl8192cu_hal_ops = {
|
||||
.init_sw_vars = rtl92cu_init_sw_vars,
|
||||
.deinit_sw_vars = rtl92cu_deinit_sw_vars,
|
||||
.read_chip_version = rtl92c_read_chip_version,
|
||||
|
|
@ -156,7 +156,7 @@ static struct rtl_hal_usbint_cfg rtl92cu_interface_cfg = {
|
|||
.usb_mq_to_hwq = rtl8192cu_mq_to_hwq,
|
||||
};
|
||||
|
||||
static struct rtl_hal_cfg rtl92cu_hal_cfg = {
|
||||
static const struct rtl_hal_cfg rtl92cu_hal_cfg = {
|
||||
.name = "rtl92c_usb",
|
||||
.alt_fw_name = "rtlwifi/rtl8192cufw.bin",
|
||||
.ops = &rtl8192cu_hal_ops,
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ static void rtl92d_deinit_sw_vars(struct ieee80211_hw *hw)
|
|||
skb_queue_purge(&rtlpriv->mac80211.skb_waitq[tid]);
|
||||
}
|
||||
|
||||
static struct rtl_hal_ops rtl8192de_hal_ops = {
|
||||
static const struct rtl_hal_ops rtl8192de_hal_ops = {
|
||||
.init_sw_vars = rtl92d_init_sw_vars,
|
||||
.deinit_sw_vars = rtl92d_deinit_sw_vars,
|
||||
.read_eeprom_info = rtl92d_read_eeprom_info,
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ static bool rtl92ee_get_btc_status(void)
|
|||
return true;
|
||||
}
|
||||
|
||||
static struct rtl_hal_ops rtl8192ee_hal_ops = {
|
||||
static const struct rtl_hal_ops rtl8192ee_hal_ops = {
|
||||
.init_sw_vars = rtl92ee_init_sw_vars,
|
||||
.deinit_sw_vars = rtl92ee_deinit_sw_vars,
|
||||
.read_eeprom_info = rtl92ee_read_eeprom_info,
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ static bool rtl92se_is_tx_desc_closed(struct ieee80211_hw *hw, u8 hw_queue,
|
|||
return true;
|
||||
}
|
||||
|
||||
static struct rtl_hal_ops rtl8192se_hal_ops = {
|
||||
static const struct rtl_hal_ops rtl8192se_hal_ops = {
|
||||
.init_sw_vars = rtl92s_init_sw_vars,
|
||||
.deinit_sw_vars = rtl92s_deinit_sw_vars,
|
||||
.read_eeprom_info = rtl92se_read_eeprom_info,
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ static bool is_fw_header(struct rtlwifi_firmware_header *hdr)
|
|||
return (le16_to_cpu(hdr->signature) & 0xfff0) == 0x2300;
|
||||
}
|
||||
|
||||
static struct rtl_hal_ops rtl8723e_hal_ops = {
|
||||
static const struct rtl_hal_ops rtl8723e_hal_ops = {
|
||||
.init_sw_vars = rtl8723e_init_sw_vars,
|
||||
.deinit_sw_vars = rtl8723e_deinit_sw_vars,
|
||||
.read_eeprom_info = rtl8723e_read_eeprom_info,
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ static bool is_fw_header(struct rtlwifi_firmware_header *hdr)
|
|||
return (le16_to_cpu(hdr->signature) & 0xfff0) == 0x5300;
|
||||
}
|
||||
|
||||
static struct rtl_hal_ops rtl8723be_hal_ops = {
|
||||
static const struct rtl_hal_ops rtl8723be_hal_ops = {
|
||||
.init_sw_vars = rtl8723be_init_sw_vars,
|
||||
.deinit_sw_vars = rtl8723be_deinit_sw_vars,
|
||||
.read_eeprom_info = rtl8723be_read_eeprom_info,
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ static bool rtl8821ae_get_btc_status(void)
|
|||
return true;
|
||||
}
|
||||
|
||||
static struct rtl_hal_ops rtl8821ae_hal_ops = {
|
||||
static const struct rtl_hal_ops rtl8821ae_hal_ops = {
|
||||
.init_sw_vars = rtl8821ae_init_sw_vars,
|
||||
.deinit_sw_vars = rtl8821ae_deinit_sw_vars,
|
||||
.read_eeprom_info = rtl8821ae_read_eeprom_info,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user