Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1738171
| Path | csiph.com!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Himanshu Jha <himanshujha199640@gmail.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCH] s390/sclp: Use setup_timer and mod_timer |
| Date | Sun, 24 Sep 2017 14:10:01 +0200 |
| Message-ID | <utdTr-5b-7@gated-at.bofh.it> (permalink) |
| X-Original-To | schwidefsky@de.ibm.com |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=8fQFzhYSJYrjVPyMYG73nnt8snzWI87wvuEce6vE8Sw=; b=DNDlDXGyj9ZksLRU1hdazQcqubebxd+wm1WBLCv9rvJTMzS4MLUj3Vueq1r2OG/Yha dmj3gmlCDCIoYfhwLS0M1n6cx/8xSoyLleKDkTWFGB01/IQSKBvzkghdniY8pZdcg9f2 NcWJFqBKadDBDYnh6T9kpN4Uw0sfxBj3RINgb9nuYUOjOk9E7U39PhcEvhgaGw2hNYhi BhormYak+sHs7gpWwqV12XitLlmnSRPi4HX/e9SkMwCPOYo1q8LQCUz2v0Mx17GhjjLE AiwvRts1IqkDGuvk1Pa7izlLEy6jgE4NrbDoSbMEZ+IIe4GcXCLaImNI1sDOEJG5Ptu2 g29A== |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=8fQFzhYSJYrjVPyMYG73nnt8snzWI87wvuEce6vE8Sw=; b=qB1jirFZTC7yJYa56uDTVzv8qTXHw2TU9EdOIAIWF8kbgCtR7+V/o2wgoePHQCCXX4 h7V9YZgZ2kfXKLALGx20Lnv8Ummq1A/qA4/detGOiSskmN2a4OgJO3mO0hfk5qeOuGN9 z9T6cBWDXnvAyC++VpxPtsOi6hmT1n3U8uRok5AbiQbZbZxjwP+Vs3Lujx/AD7RIQM1e vlioE6oKZLlxRMeHiYhd+AHnPwuYrLuak0QL4ztUpthztxbteuDRqyadQ0SrzRuJ0dz4 WipFMpGOlGrJwTTOq4UVCk/aSAwv6eobpCTjYrbBRkweOyK7gNPo567GuATmDyUBzgoZ VtmA== |
| X-Gm-Message-State | AHPjjUh2qS+BhnBqp9dxbmFWpkzxMJRwV900wrWfzxY9uG5PchqhrrY+ 7itP5HrApUYF5kL2bwJTkT8= |
| X-Google-SMTP-Source | AOwi7QAUos9hQMLISETv92YqZJZxeHQZOOPqe1f8QNz4JmIQlHleX7JBIArahGesidcbxztdbsWvJA== |
| X-Received | by 10.99.117.81 with SMTP id f17mr4668386pgn.314.1506254431934; Sun, 24 Sep 2017 05:00:31 -0700 (PDT) |
| X-Mailer | git-send-email 2.7.4 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 61 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | heiko.carstens@de.ibm.com, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, Himanshu Jha <himanshujha199640@gmail.com> |
| X-Original-Date | Sun, 24 Sep 2017 17:30:14 +0530 |
| X-Original-Message-ID | <1506254414-10269-1-git-send-email-himanshujha199640@gmail.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1738171 |
Show key headers only | View raw
Use setup_timer and mod_timer API instead of structure assignments.
This is done using Coccinelle and semantic patch used
for this as follows:
@@
expression x,y,z,a,b;
@@
-init_timer (&x);
+setup_timer (&x, y, z);
+mod_timer (&a, b);
-x.function = y;
-x.data = z;
-x.expires = b;
-add_timer(&a);
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
---
drivers/s390/char/sclp_con.c | 7 ++-----
drivers/s390/char/sclp_tty.c | 7 ++-----
2 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/drivers/s390/char/sclp_con.c b/drivers/s390/char/sclp_con.c
index 6037bc8..9b5ac8f 100644
--- a/drivers/s390/char/sclp_con.c
+++ b/drivers/s390/char/sclp_con.c
@@ -210,11 +210,8 @@ sclp_console_write(struct console *console, const char *message,
/* Setup timer to output current console buffer after 1/10 second */
if (sclp_conbuf != NULL && sclp_chars_in_buffer(sclp_conbuf) != 0 &&
!timer_pending(&sclp_con_timer)) {
- init_timer(&sclp_con_timer);
- sclp_con_timer.function = sclp_console_timeout;
- sclp_con_timer.data = 0UL;
- sclp_con_timer.expires = jiffies + HZ/10;
- add_timer(&sclp_con_timer);
+ setup_timer(&sclp_con_timer, sclp_console_timeout, 0UL);
+ mod_timer(&sclp_con_timer, jiffies + HZ / 10);
}
out:
spin_unlock_irqrestore(&sclp_con_lock, flags);
diff --git a/drivers/s390/char/sclp_tty.c b/drivers/s390/char/sclp_tty.c
index 236b736..469487e 100644
--- a/drivers/s390/char/sclp_tty.c
+++ b/drivers/s390/char/sclp_tty.c
@@ -217,11 +217,8 @@ static int sclp_tty_write_string(const unsigned char *str, int count, int may_fa
/* Setup timer to output current console buffer after 1/10 second */
if (sclp_ttybuf && sclp_chars_in_buffer(sclp_ttybuf) &&
!timer_pending(&sclp_tty_timer)) {
- init_timer(&sclp_tty_timer);
- sclp_tty_timer.function = sclp_tty_timeout;
- sclp_tty_timer.data = 0UL;
- sclp_tty_timer.expires = jiffies + HZ/10;
- add_timer(&sclp_tty_timer);
+ setup_timer(&sclp_tty_timer, sclp_tty_timeout, 0UL);
+ mod_timer(&sclp_tty_timer, jiffies + HZ / 10);
}
spin_unlock_irqrestore(&sclp_tty_lock, flags);
out:
--
2.7.4
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] s390/sclp: Use setup_timer and mod_timer Himanshu Jha <himanshujha199640@gmail.com> - 2017-09-24 14:10 +0200 Re: [PATCH] s390/sclp: Use setup_timer and mod_timer Martin Schwidefsky <schwidefsky@de.ibm.com> - 2017-09-25 07:30 +0200
csiph-web