diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2020-09-29 23:25:43 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-09-30 00:02:55 +0300 |
commit | a3b7b227f1250a90c8a9542ea6398a61e1708174 (patch) | |
tree | f3409bfc2e9595cc1bd92fd265801b269286fe5e /drivers/net/wireless/realtek/rtlwifi/ps.h | |
parent | 021b58ef51bb0e59d456e2101689052ff03a82e2 (diff) | |
download | linux-a3b7b227f1250a90c8a9542ea6398a61e1708174.tar.xz |
net: rtlwifi: Remove void* casts related to delayed work
INIT_DELAYED_WORK() takes two arguments: A pointer to the delayed work and
a function reference for the callback.
The rtl code casts all function references to (void *) because the
callbacks in use are not matching the required function signature. That's
error prone and bad pratice.
Some of the callback functions are also global, but only used in a single
file.
Clean the mess up by:
- Adding the proper arguments to the callback functions and using them in
the container_of() constructs correctly which removes the hideous
container_of_dwork_rtl() macro as well.
- Removing the type cast at the initializers
- Making the unnecessary global functions static
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/realtek/rtlwifi/ps.h')
-rw-r--r-- | drivers/net/wireless/realtek/rtlwifi/ps.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/wireless/realtek/rtlwifi/ps.h b/drivers/net/wireless/realtek/rtlwifi/ps.h index aaa2ed2bbe16..87aacf8c753f 100644 --- a/drivers/net/wireless/realtek/rtlwifi/ps.h +++ b/drivers/net/wireless/realtek/rtlwifi/ps.h @@ -10,15 +10,15 @@ bool rtl_ps_enable_nic(struct ieee80211_hw *hw); bool rtl_ps_disable_nic(struct ieee80211_hw *hw); void rtl_ips_nic_off(struct ieee80211_hw *hw); void rtl_ips_nic_on(struct ieee80211_hw *hw); -void rtl_ips_nic_off_wq_callback(void *data); +void rtl_ips_nic_off_wq_callback(struct work_struct *work); void rtl_lps_enter(struct ieee80211_hw *hw); void rtl_lps_leave(struct ieee80211_hw *hw); void rtl_lps_set_psmode(struct ieee80211_hw *hw, u8 rt_psmode); void rtl_swlps_beacon(struct ieee80211_hw *hw, void *data, unsigned int len); -void rtl_swlps_wq_callback(void *data); -void rtl_swlps_rfon_wq_callback(void *data); +void rtl_swlps_wq_callback(struct work_struct *work); +void rtl_swlps_rfon_wq_callback(struct work_struct *work); void rtl_swlps_rf_awake(struct ieee80211_hw *hw); void rtl_swlps_rf_sleep(struct ieee80211_hw *hw); void rtl_p2p_ps_cmd(struct ieee80211_hw *hw , u8 p2p_ps_state); |