From 7ac767645ab1f2f96b2c84ee8857d72d25c4eadd Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Tue, 24 Oct 2017 02:29:54 -0700 Subject: ath: Convert timers to use timer_setup() In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Kalle Valo Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Kees Cook Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath9k/channel.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'drivers/net/wireless/ath/ath9k/channel.c') diff --git a/drivers/net/wireless/ath/ath9k/channel.c b/drivers/net/wireless/ath/ath9k/channel.c index fad020aa222e..dfb26f03c1a2 100644 --- a/drivers/net/wireless/ath/ath9k/channel.c +++ b/drivers/net/wireless/ath/ath9k/channel.c @@ -1043,9 +1043,9 @@ static void ath_scan_channel_start(struct ath_softc *sc) mod_timer(&sc->offchannel.timer, jiffies + sc->offchannel.duration); } -static void ath_chanctx_timer(unsigned long data) +static void ath_chanctx_timer(struct timer_list *t) { - struct ath_softc *sc = (struct ath_softc *) data; + struct ath_softc *sc = from_timer(sc, t, sched.timer); struct ath_common *common = ath9k_hw_common(sc->sc_ah); ath_dbg(common, CHAN_CTX, @@ -1054,9 +1054,9 @@ static void ath_chanctx_timer(unsigned long data) ath_chanctx_event(sc, NULL, ATH_CHANCTX_EVENT_TSF_TIMER); } -static void ath_offchannel_timer(unsigned long data) +static void ath_offchannel_timer(struct timer_list *t) { - struct ath_softc *sc = (struct ath_softc *)data; + struct ath_softc *sc = from_timer(sc, t, offchannel.timer); struct ath_chanctx *ctx; struct ath_common *common = ath9k_hw_common(sc->sc_ah); @@ -1362,10 +1362,8 @@ void ath9k_init_channel_context(struct ath_softc *sc) { INIT_WORK(&sc->chanctx_work, ath_chanctx_work); - setup_timer(&sc->offchannel.timer, ath_offchannel_timer, - (unsigned long)sc); - setup_timer(&sc->sched.timer, ath_chanctx_timer, - (unsigned long)sc); + timer_setup(&sc->offchannel.timer, ath_offchannel_timer, 0); + timer_setup(&sc->sched.timer, ath_chanctx_timer, 0); init_completion(&sc->go_beacon); } -- cgit v1.2.3