]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
timer: Remove meaningless .data/.function assignments
authorKees Cook <keescook@chromium.org>
Tue, 10 Oct 2017 00:10:32 +0000 (17:10 -0700)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 17 Oct 2017 15:37:36 +0000 (17:37 +0200)
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.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> # for staging
Acked-by: Krzysztof Halasa <khc@pm.waw.pl> # for wan/hdlc*
Acked-by: Jens Axboe <axboe@kernel.dk> # for amiflop
Cc: devel@driverdev.osuosl.org
Cc: netdev@vger.kernel.org
Cc: linux-wireless@vger.kernel.org
Cc: Jens Axboe <axboe@fb.com>
Cc: Ganesh Krishna <ganesh.krishna@microchip.com>
Cc: Aditya Shankar <aditya.shankar@microchip.com>
Link: https://lkml.kernel.org/r/20171010001032.GA119829@beast
drivers/block/amiflop.c
drivers/net/wan/hdlc_cisco.c
drivers/net/wan/hdlc_fr.c
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c

index 49908c74bfcb0fae9eb30f84d969a4c520192e39..4e3fb9f104aff36a575828d17d72cabf5ed5ea00 100644 (file)
@@ -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;
index a408abc25512aca0d94f16bbe0cefa0cdd758aaf..f4b0ab34f04838d24333f47de7f1f5620fa8c018 100644 (file)
@@ -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);
 }
 
index 78596e42a3f3f27623284c86a0d791a2bf4a65b6..07f265fa2826a97333eedb0cc06fd40198166b13 100644 (file)
@@ -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);
 }
 
index ac5aaafa461cf33a0ff4cbb772b3fe70a3f5ca9a..60f088babf27edce8e6c0b203ccb05a2f9d13997 100644 (file)
@@ -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 {