summaryrefslogtreecommitdiffstats
path: root/drivers/s390/char/sclp_vt220.c
diff options
context:
space:
mode:
authorYu Liao <liaoyu15@huawei.com>2022-03-22 11:00:57 +0800
committerVasily Gorbik <gor@linux.ibm.com>2022-03-27 22:18:39 +0200
commit4f45c37ffd100522f890fc7f8bd71a3b8f79b6be (patch)
tree53711063a23226deb4239e8449e0c1eaf1de4260 /drivers/s390/char/sclp_vt220.c
parent97f32e11730e05927df196bcc8e30d8f2bcbb181 (diff)
downloadlinux-stable-4f45c37ffd100522f890fc7f8bd71a3b8f79b6be.tar.gz
linux-stable-4f45c37ffd100522f890fc7f8bd71a3b8f79b6be.tar.bz2
linux-stable-4f45c37ffd100522f890fc7f8bd71a3b8f79b6be.zip
s390: cleanup timer API use
cleanup the s390's use of the timer API - del_timer() contains timer_pending() condition - mod_timer(timer, expires) is equivalent to: del_timer(timer); timer->expires = expires; add_timer(timer); If the timer is inactive it will be activated, using add_timer() on condition !timer_pending(&private->timer) is redundant. Just cleanup, no logic change. Signed-off-by: Yu Liao <liaoyu15@huawei.com> Link: https://lore.kernel.org/r/20220322030057.1243196-1-liaoyu15@huawei.com Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'drivers/s390/char/sclp_vt220.c')
-rw-r--r--drivers/s390/char/sclp_vt220.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/s390/char/sclp_vt220.c b/drivers/s390/char/sclp_vt220.c
index 7bc4e4a10937..3b4e7e5d9b71 100644
--- a/drivers/s390/char/sclp_vt220.c
+++ b/drivers/s390/char/sclp_vt220.c
@@ -231,8 +231,7 @@ sclp_vt220_emit_current(void)
list_add_tail(&sclp_vt220_current_request->list,
&sclp_vt220_outqueue);
sclp_vt220_current_request = NULL;
- if (timer_pending(&sclp_vt220_timer))
- del_timer(&sclp_vt220_timer);
+ del_timer(&sclp_vt220_timer);
}
sclp_vt220_flush_later = 0;
}
@@ -776,8 +775,7 @@ static void __sclp_vt220_flush_buffer(void)
sclp_vt220_emit_current();
spin_lock_irqsave(&sclp_vt220_lock, flags);
- if (timer_pending(&sclp_vt220_timer))
- del_timer(&sclp_vt220_timer);
+ del_timer(&sclp_vt220_timer);
while (sclp_vt220_queue_running) {
spin_unlock_irqrestore(&sclp_vt220_lock, flags);
sclp_sync_wait();