timer: Remove meaningless .data/.function assignments
Subsystems (5)
PATCH 1/1 timer: Remove meaningless .data/.function assignments
Several timer users needlessly reset their .function/.data fields during their timer callback, but nothing else changes them. Some users do not use their .data field at all. Each instance is removed here.
---
This should go via the timer/core tree, please. It's been acked by each of the maintainers. Thanks!
--- drivers/block/amiflop.c | 3 +-- drivers/net/wan/hdlc_cisco.c | 2 -- drivers/net/wan/hdlc_fr.c | 2 -- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 4 +--- 4 files changed, 2 insertions(+), 9 deletions(-)
drivers/block/amiflop.c +1 -2
@@ -323,7 +323,7 @@ static void fd_deselect (int drive) } -static void motor_on_callback (unsigned long nr) +static void motor_on_callback (unsigned long ignored) {if (!(ciaa.pra &DSKRDY ) || --on_attempts ==0 ) {complete_all (&motor_on_completion);
@@ -344,7 +344,6 @@ static int fd_motor_on(int nr)fd_select (nr);reinit_completion (&motor_on_completion); - motor_on_timer.data = nr;mod_timer (&motor_on_timer, jiffies +HZ /2 ); on_attempts =10 ;
drivers/net/wan/hdlc_cisco.c +0 -2
@@ -276,8 +276,6 @@ static void cisco_timer(unsigned long arg)spin_unlock (&st->lock); st->timer.expires = jiffies + st->settings.interval *HZ ; - st->timer.function = cisco_timer; - st->timer.data = arg;add_timer (&st->timer); }
drivers/net/wan/hdlc_fr.c +0 -2
@@ -644,8 +644,6 @@ static void fr_timer(unsigned long arg)state (hdlc)->settings.t391 *HZ ; } -state (hdlc)->timer.function = fr_timer; -state (hdlc)->timer.data = arg;add_timer (&state (hdlc)->timer); }
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +1 -3
@@ -266,7 +266,7 @@ static void update_scan_time(void) last_scanned_shadow[i].time_scan = jiffies; } -static void remove_network_from_shadow (unsigned long arg) +static void remove_network_from_shadow (unsigned long unused) {unsigned long now = jiffies;int i, j;
@@ -287,7 +287,6 @@ static void remove_network_from_shadow(unsigned long arg) }if (last_scanned_cnt !=0 ) { - hAgingTimer.data = arg;mod_timer (&hAgingTimer, jiffies +msecs_to_jiffies (AGING_TIME )); } }
@@ -304,7 +303,6 @@ static int is_network_in_shadow(struct network_info *pstrNetworkInfo,int i;if (last_scanned_cnt ==0 ) { - hAgingTimer.data = (unsigned long )user_void;mod_timer (&hAgingTimer, jiffies +msecs_to_jiffies (AGING_TIME )); state =-1 ; }else {
Signature · 6 lines
2.7.4 -- Kees Cook Pixel Security
From: Kees Cook <[email protected]>
Date: Mon, 9 Oct 2017 17:10:32 -0700
Quoted 16 lines
Several timer users needlessly reset their .function/.data fields during their timer callback, but nothing else changes them. Some users do not use their .data field at all. Each instance is removed here.
Cc Krzysztof Halasa <[email protected]>Cc Aditya Shankar <[email protected]>Cc Ganesh Krishna <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Cc Jens Axboe <[email protected]>Signed-off-by Kees Cook <[email protected]>
Quoted 3 lines
---
This should go via the timer/core tree, please. It's been acked by each of the maintainers. Thanks!
For networking bits:
tip-bot for Kees Cook
merge bottimer: Remove meaningless .data/.function assignments
Commit-ID: 3c557df67257c114401f18ee412f0b74091c3c6f Gitweb: https://git.kernel.org/tip/3c557df67257c114401f18ee412f0b74091c3c6f Author: Kees Cook <[email protected]> AuthorDate: Mon, 9 Oct 2017 17:10:32 -0700 Committer: Thomas Gleixner <[email protected]> CommitDate: Tue, 17 Oct 2017 17:37:36 +0200
timer: Remove meaningless .data/.function assignments
Several timer users needlessly reset their .function/.data fields during their timer callback, but nothing else changes them. Some users do not use their .data field at all. Each instance is removed here.
--- drivers/block/amiflop.c | 3 +-- drivers/net/wan/hdlc_cisco.c | 2 -- drivers/net/wan/hdlc_fr.c | 2 -- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 4 +--- 4 files changed, 2 insertions(+), 9 deletions(-)
drivers/block/amiflop.c +1 -2
@@ -323,7 +323,7 @@ static void fd_deselect (int drive) } -static void motor_on_callback (unsigned long nr) +static void motor_on_callback (unsigned long ignored) {if (!(ciaa.pra &DSKRDY ) || --on_attempts ==0 ) {complete_all (&motor_on_completion);
@@ -344,7 +344,6 @@ static int fd_motor_on(int nr)fd_select (nr);reinit_completion (&motor_on_completion); - motor_on_timer.data = nr;mod_timer (&motor_on_timer, jiffies +HZ /2 ); on_attempts =10 ;
drivers/net/wan/hdlc_cisco.c +0 -2
@@ -276,8 +276,6 @@ static void cisco_timer(unsigned long arg)spin_unlock (&st->lock); st->timer.expires = jiffies + st->settings.interval *HZ ; - st->timer.function = cisco_timer; - st->timer.data = arg;add_timer (&st->timer); }
drivers/net/wan/hdlc_fr.c +0 -2
@@ -644,8 +644,6 @@ static void fr_timer(unsigned long arg)state (hdlc)->settings.t391 *HZ ; } -state (hdlc)->timer.function = fr_timer; -state (hdlc)->timer.data = arg;add_timer (&state (hdlc)->timer); }
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +1 -3
@@ -266,7 +266,7 @@ static void update_scan_time(void) last_scanned_shadow[i].time_scan = jiffies; } -static void remove_network_from_shadow (unsigned long arg) +static void remove_network_from_shadow (unsigned long unused) {unsigned long now = jiffies;int i, j;
@@ -287,7 +287,6 @@ static void remove_network_from_shadow(unsigned long arg) }if (last_scanned_cnt !=0 ) { - hAgingTimer.data = arg;mod_timer (&hAgingTimer, jiffies +msecs_to_jiffies (AGING_TIME )); } }
@@ -304,7 +303,6 @@ static int is_network_in_shadow(struct network_info *pstrNetworkInfo,int i;if (last_scanned_cnt ==0 ) { - hAgingTimer.data = (unsigned long )user_void;mod_timer (&hAgingTimer, jiffies +msecs_to_jiffies (AGING_TIME )); state =-1 ; }else {