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>
This commit is contained in:
parent
97f32e1173
commit
4f45c37ffd
@ -745,9 +745,7 @@ sclp_sync_wait(void)
|
|||||||
/* Loop until driver state indicates finished request */
|
/* Loop until driver state indicates finished request */
|
||||||
while (sclp_running_state != sclp_running_state_idle) {
|
while (sclp_running_state != sclp_running_state_idle) {
|
||||||
/* Check for expired request timer */
|
/* Check for expired request timer */
|
||||||
if (timer_pending(&sclp_request_timer) &&
|
if (get_tod_clock_fast() > timeout && del_timer(&sclp_request_timer))
|
||||||
get_tod_clock_fast() > timeout &&
|
|
||||||
del_timer(&sclp_request_timer))
|
|
||||||
sclp_request_timer.function(&sclp_request_timer);
|
sclp_request_timer.function(&sclp_request_timer);
|
||||||
cpu_relax();
|
cpu_relax();
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,6 @@ static void sclp_console_sync_queue(void)
|
|||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
spin_lock_irqsave(&sclp_con_lock, flags);
|
spin_lock_irqsave(&sclp_con_lock, flags);
|
||||||
if (timer_pending(&sclp_con_timer))
|
|
||||||
del_timer(&sclp_con_timer);
|
del_timer(&sclp_con_timer);
|
||||||
while (sclp_con_queue_running) {
|
while (sclp_con_queue_running) {
|
||||||
spin_unlock_irqrestore(&sclp_con_lock, flags);
|
spin_unlock_irqrestore(&sclp_con_lock, flags);
|
||||||
|
@ -231,7 +231,6 @@ sclp_vt220_emit_current(void)
|
|||||||
list_add_tail(&sclp_vt220_current_request->list,
|
list_add_tail(&sclp_vt220_current_request->list,
|
||||||
&sclp_vt220_outqueue);
|
&sclp_vt220_outqueue);
|
||||||
sclp_vt220_current_request = NULL;
|
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;
|
sclp_vt220_flush_later = 0;
|
||||||
@ -776,7 +775,6 @@ static void __sclp_vt220_flush_buffer(void)
|
|||||||
|
|
||||||
sclp_vt220_emit_current();
|
sclp_vt220_emit_current();
|
||||||
spin_lock_irqsave(&sclp_vt220_lock, flags);
|
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) {
|
while (sclp_vt220_queue_running) {
|
||||||
spin_unlock_irqrestore(&sclp_vt220_lock, flags);
|
spin_unlock_irqrestore(&sclp_vt220_lock, flags);
|
||||||
|
@ -113,16 +113,10 @@ ccw_device_timeout(struct timer_list *t)
|
|||||||
void
|
void
|
||||||
ccw_device_set_timeout(struct ccw_device *cdev, int expires)
|
ccw_device_set_timeout(struct ccw_device *cdev, int expires)
|
||||||
{
|
{
|
||||||
if (expires == 0) {
|
if (expires == 0)
|
||||||
del_timer(&cdev->private->timer);
|
del_timer(&cdev->private->timer);
|
||||||
return;
|
else
|
||||||
}
|
mod_timer(&cdev->private->timer, jiffies + expires);
|
||||||
if (timer_pending(&cdev->private->timer)) {
|
|
||||||
if (mod_timer(&cdev->private->timer, jiffies + expires))
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
cdev->private->timer.expires = jiffies + expires;
|
|
||||||
add_timer(&cdev->private->timer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -112,16 +112,10 @@ static void eadm_subchannel_set_timeout(struct subchannel *sch, int expires)
|
|||||||
{
|
{
|
||||||
struct eadm_private *private = get_eadm_private(sch);
|
struct eadm_private *private = get_eadm_private(sch);
|
||||||
|
|
||||||
if (expires == 0) {
|
if (expires == 0)
|
||||||
del_timer(&private->timer);
|
del_timer(&private->timer);
|
||||||
return;
|
else
|
||||||
}
|
mod_timer(&private->timer, jiffies + expires);
|
||||||
if (timer_pending(&private->timer)) {
|
|
||||||
if (mod_timer(&private->timer, jiffies + expires))
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
private->timer.expires = jiffies + expires;
|
|
||||||
add_timer(&private->timer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void eadm_subchannel_irq(struct subchannel *sch)
|
static void eadm_subchannel_irq(struct subchannel *sch)
|
||||||
|
Loading…
Reference in New Issue
Block a user