Use setup_deferrable_timer() instead of init_timer_deferrable() to
simplify the code.
Signed-off-by: Geliang Tang <[email protected]>
---
drivers/acpi/apei/ghes.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index b192b42..33ca196 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -1005,9 +1005,8 @@ static int ghes_probe(struct platform_device *ghes_dev)
switch (generic->notify.type) {
case ACPI_HEST_NOTIFY_POLLED:
- ghes->timer.function = ghes_poll_func;
- ghes->timer.data = (unsigned long)ghes;
- init_timer_deferrable(&ghes->timer);
+ setup_deferrable_timer(&ghes->timer, ghes_poll_func,
+ (unsigned long)ghes);
ghes_add_timer(ghes);
break;
case ACPI_HEST_NOTIFY_EXTERNAL:
--
2.9.3
Use setup_timer() instead of init_timer() to simplify the code.
Signed-off-by: Geliang Tang <[email protected]>
---
drivers/bluetooth/bluecard_cs.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c
index c0b3b55..007c0a4 100644
--- a/drivers/bluetooth/bluecard_cs.c
+++ b/drivers/bluetooth/bluecard_cs.c
@@ -695,9 +695,8 @@ static int bluecard_open(struct bluecard_info *info)
spin_lock_init(&(info->lock));
- init_timer(&(info->timer));
- info->timer.function = &bluecard_activity_led_timeout;
- info->timer.data = (u_long)info;
+ setup_timer(&(info->timer), &bluecard_activity_led_timeout,
+ (u_long)info);
skb_queue_head_init(&(info->txq));
--
2.9.3
Use setup_timer() instead of init_timer() to simplify the code.
Signed-off-by: Geliang Tang <[email protected]>
---
drivers/atm/ambassador.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c
index 4a61079..906705e 100644
--- a/drivers/atm/ambassador.c
+++ b/drivers/atm/ambassador.c
@@ -2267,9 +2267,8 @@ static int amb_probe(struct pci_dev *pci_dev,
dev->atm_dev->ci_range.vpi_bits = NUM_VPI_BITS;
dev->atm_dev->ci_range.vci_bits = NUM_VCI_BITS;
- init_timer(&dev->housekeeping);
- dev->housekeeping.function = do_housekeeping;
- dev->housekeeping.data = (unsigned long) dev;
+ setup_timer(&dev->housekeeping, do_housekeeping,
+ (unsigned long)dev);
mod_timer(&dev->housekeeping, jiffies);
// enable host interrupts
--
2.9.3
Use setup_timer() instead of init_timer() to simplify the code.
Signed-off-by: Geliang Tang <[email protected]>
---
net/core/drop_monitor.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
index fb55327..70ccda2 100644
--- a/net/core/drop_monitor.c
+++ b/net/core/drop_monitor.c
@@ -412,9 +412,8 @@ static int __init init_net_drop_monitor(void)
for_each_possible_cpu(cpu) {
data = &per_cpu(dm_cpu_data, cpu);
INIT_WORK(&data->dm_alert_work, send_dm_alert);
- init_timer(&data->send_timer);
- data->send_timer.data = (unsigned long)data;
- data->send_timer.function = sched_send_work;
+ setup_timer(&data->send_timer, sched_send_work,
+ (unsigned long)data);
spin_lock_init(&data->lock);
reset_per_cpu_data(data);
}
--
2.9.3
Use setup_deferrable_timer() instead of init_timer_deferrable() to
simplify the code.
Signed-off-by: Geliang Tang <[email protected]>
---
drivers/ata/libata-core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index ca75823..55d3c8b 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5902,9 +5902,9 @@ struct ata_port *ata_port_alloc(struct ata_host *host)
INIT_LIST_HEAD(&ap->eh_done_q);
init_waitqueue_head(&ap->eh_wait_q);
init_completion(&ap->park_req_pending);
- init_timer_deferrable(&ap->fastdrain_timer);
- ap->fastdrain_timer.function = ata_eh_fastdrain_timerfn;
- ap->fastdrain_timer.data = (unsigned long)ap;
+ setup_deferrable_timer(&ap->fastdrain_timer,
+ ata_eh_fastdrain_timerfn,
+ (unsigned long)ap);
ap->cbl = ATA_CBL_NONE;
--
2.9.3
Use setup_timer() instead of init_timer() to simplify the code.
Signed-off-by: Geliang Tang <[email protected]>
---
fs/ocfs2/cluster/tcp.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c
index 4348027..de51b23 100644
--- a/fs/ocfs2/cluster/tcp.c
+++ b/fs/ocfs2/cluster/tcp.c
@@ -450,9 +450,8 @@ static struct o2net_sock_container *sc_alloc(struct o2nm_node *node)
INIT_WORK(&sc->sc_shutdown_work, o2net_shutdown_sc);
INIT_DELAYED_WORK(&sc->sc_keepalive_work, o2net_sc_send_keep_req);
- init_timer(&sc->sc_idle_timeout);
- sc->sc_idle_timeout.function = o2net_idle_timer;
- sc->sc_idle_timeout.data = (unsigned long)sc;
+ setup_timer(&sc->sc_idle_timeout, o2net_idle_timer,
+ (unsigned long)sc);
sclog(sc, "alloced\n");
--
2.9.3
Use setup_timer() instead of init_timer() to simplify the code.
Signed-off-by: Geliang Tang <[email protected]>
---
drivers/auxdisplay/img-ascii-lcd.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/auxdisplay/img-ascii-lcd.c b/drivers/auxdisplay/img-ascii-lcd.c
index bf43b5d..1f30b7e 100644
--- a/drivers/auxdisplay/img-ascii-lcd.c
+++ b/drivers/auxdisplay/img-ascii-lcd.c
@@ -393,9 +393,7 @@ static int img_ascii_lcd_probe(struct platform_device *pdev)
ctx->scroll_rate = HZ / 2;
/* initialise a timer for scrolling the message */
- init_timer(&ctx->timer);
- ctx->timer.function = img_ascii_lcd_scroll;
- ctx->timer.data = (unsigned long)ctx;
+ setup_timer(&ctx->timer, img_ascii_lcd_scroll, (unsigned long)ctx);
platform_set_drvdata(pdev, ctx);
--
2.9.3
From: Geliang Tang <[email protected]>
Date: Sat, 11 Mar 2017 08:46:56 +0800
> Use setup_timer() instead of init_timer() to simplify the code.
>
> Signed-off-by: Geliang Tang <[email protected]>
Applied.
From: Geliang Tang <[email protected]>
Date: Sat, 11 Mar 2017 08:46:59 +0800
> Use setup_timer() instead of init_timer() to simplify the code.
>
> Signed-off-by: Geliang Tang <[email protected]>
Applied.
On Sat, Mar 11, 2017 at 08:47:01AM +0800, Geliang Tang wrote:
> Use setup_deferrable_timer() instead of init_timer_deferrable() to
> simplify the code.
>
> Signed-off-by: Geliang Tang <[email protected]>
Applied to libata/for-4.12.
Thanks.
--
tejun
Hi Geliang,
On Friday, 10 March 2017 16:46:57 PDT Geliang Tang wrote:
> Use setup_timer() instead of init_timer() to simplify the code.
>
> Signed-off-by: Geliang Tang <[email protected]>
> ---
> drivers/auxdisplay/img-ascii-lcd.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/auxdisplay/img-ascii-lcd.c
> b/drivers/auxdisplay/img-ascii-lcd.c index bf43b5d..1f30b7e 100644
> --- a/drivers/auxdisplay/img-ascii-lcd.c
> +++ b/drivers/auxdisplay/img-ascii-lcd.c
> @@ -393,9 +393,7 @@ static int img_ascii_lcd_probe(struct platform_device
> *pdev) ctx->scroll_rate = HZ / 2;
>
> /* initialise a timer for scrolling the message */
> - init_timer(&ctx->timer);
> - ctx->timer.function = img_ascii_lcd_scroll;
> - ctx->timer.data = (unsigned long)ctx;
> + setup_timer(&ctx->timer, img_ascii_lcd_scroll, (unsigned long)ctx);
>
> platform_set_drvdata(pdev, ctx);
Thanks for the patch:
Reviewed-by: Paul Burton <[email protected]>
I've CC'd Ralf & Andrew since a couple of other patches to this driver have
been waiting for someone to merge them for a while, and whilst it's unclear
which path those patches & this one should take into mainline they've been
suggested so far (besides Miguel who seems not to be active).
I've also CC'd the trivial patch monkey in case this can get in through that
route, though I'm unsure whether CC'ing on a reply is sufficient so you might
like to resend with [email protected] CC'd on the patch.
Thanks,
Paul
Works for me!
On 3/10/2017 5:46 PM, Geliang Tang wrote:
> Use setup_deferrable_timer() instead of init_timer_deferrable() to
> simplify the code.
>
> Signed-off-by: Geliang Tang <[email protected]>
Tested-by: Tyler Baicar <[email protected]>
> ---
> drivers/acpi/apei/ghes.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
> index b192b42..33ca196 100644
> --- a/drivers/acpi/apei/ghes.c
> +++ b/drivers/acpi/apei/ghes.c
> @@ -1005,9 +1005,8 @@ static int ghes_probe(struct platform_device *ghes_dev)
>
> switch (generic->notify.type) {
> case ACPI_HEST_NOTIFY_POLLED:
> - ghes->timer.function = ghes_poll_func;
> - ghes->timer.data = (unsigned long)ghes;
> - init_timer_deferrable(&ghes->timer);
> + setup_deferrable_timer(&ghes->timer, ghes_poll_func,
> + (unsigned long)ghes);
> ghes_add_timer(ghes);
> break;
> case ACPI_HEST_NOTIFY_EXTERNAL:
--
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.
Hi Geliang,
> Use setup_timer() instead of init_timer() to simplify the code.
>
> Signed-off-by: Geliang Tang <[email protected]>
> ---
> drivers/bluetooth/bluecard_cs.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
patch has been applied to bluetooth-next tree.
Regards
Marcel
On Saturday, March 11, 2017 08:46:55 AM Geliang Tang wrote:
> Use setup_deferrable_timer() instead of init_timer_deferrable() to
> simplify the code.
>
> Signed-off-by: Geliang Tang <[email protected]>
Boris, Tony, any concerns?
If not, do you want to route this through the RAS tree?
> ---
> drivers/acpi/apei/ghes.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
> index b192b42..33ca196 100644
> --- a/drivers/acpi/apei/ghes.c
> +++ b/drivers/acpi/apei/ghes.c
> @@ -1005,9 +1005,8 @@ static int ghes_probe(struct platform_device *ghes_dev)
>
> switch (generic->notify.type) {
> case ACPI_HEST_NOTIFY_POLLED:
> - ghes->timer.function = ghes_poll_func;
> - ghes->timer.data = (unsigned long)ghes;
> - init_timer_deferrable(&ghes->timer);
> + setup_deferrable_timer(&ghes->timer, ghes_poll_func,
> + (unsigned long)ghes);
> ghes_add_timer(ghes);
> break;
> case ACPI_HEST_NOTIFY_EXTERNAL:
>
On Tue, Apr 18, 2017 at 04:41:55PM +0200, Rafael J. Wysocki wrote:
> On Saturday, March 11, 2017 08:46:55 AM Geliang Tang wrote:
> > Use setup_deferrable_timer() instead of init_timer_deferrable() to
> > simplify the code.
> >
> > Signed-off-by: Geliang Tang <[email protected]>
>
> Boris, Tony, any concerns?
>
> If not, do you want to route this through the RAS tree?
Sure, applied, thanks.
--
Regards/Gruss,
Boris.
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
--
Commit-ID: 7237c75b2717d59ebf2c2595d416e16a160154e1
Gitweb: http://git.kernel.org/tip/7237c75b2717d59ebf2c2595d416e16a160154e1
Author: Geliang Tang <[email protected]>
AuthorDate: Tue, 18 Apr 2017 20:45:28 +0200
Committer: Thomas Gleixner <[email protected]>
CommitDate: Wed, 19 Apr 2017 12:00:14 +0200
ACPI/APEI: Use setup_deferrable_timer()
Use setup_deferrable_timer() instead of init_timer_deferrable() to
simplify the code.
Signed-off-by: Geliang Tang <[email protected]>
Tested-by: Tyler Baicar <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Cc: Len Brown <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/3afa5498142ef68256023257dad37b9f8352e65e.1489060803.git.geliangtang@gmail.com
Signed-off-by: Borislav Petkov <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
---
drivers/acpi/apei/ghes.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index b192b42..33ca196 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -1005,9 +1005,8 @@ static int ghes_probe(struct platform_device *ghes_dev)
switch (generic->notify.type) {
case ACPI_HEST_NOTIFY_POLLED:
- ghes->timer.function = ghes_poll_func;
- ghes->timer.data = (unsigned long)ghes;
- init_timer_deferrable(&ghes->timer);
+ setup_deferrable_timer(&ghes->timer, ghes_poll_func,
+ (unsigned long)ghes);
ghes_add_timer(ghes);
break;
case ACPI_HEST_NOTIFY_EXTERNAL: