All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] block/aoe: Convert timers to use timer_setup()
@ 2017-10-05 23:13 Kees Cook
  2017-10-06 14:19 ` Jens Axboe
  0 siblings, 1 reply; 5+ messages in thread
From: Kees Cook @ 2017-10-05 23:13 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-kernel, Ed L. Cashin, linux-block, Thomas Gleixner

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Jens Axboe <axboe@kernel.dk>
Cc: "Ed L. Cashin" <ed.cashin@acm.org>
Cc: linux-block@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kees Cook <keescook@chromium.org>
---
v2: Rebased to linux-block.git/for-4.15/timer
---
 drivers/block/aoe/aoecmd.c | 6 +++---
 drivers/block/aoe/aoedev.c | 9 +++------
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index dc43254e05a4..55ab25f79a08 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -744,7 +744,7 @@ count_targets(struct aoedev *d, int *untainted)
 }
 
 static void
-rexmit_timer(ulong vp)
+rexmit_timer(struct timer_list *timer)
 {
 	struct aoedev *d;
 	struct aoetgt *t;
@@ -758,7 +758,7 @@ rexmit_timer(ulong vp)
 	int utgts;	/* number of aoetgt descriptors (not slots) */
 	int since;
 
-	d = (struct aoedev *) vp;
+	d = from_timer(d, timer, timer);
 
 	spin_lock_irqsave(&d->lock, flags);
 
@@ -1429,7 +1429,7 @@ aoecmd_ata_id(struct aoedev *d)
 
 	d->rttavg = RTTAVG_INIT;
 	d->rttdev = RTTDEV_INIT;
-	d->timer.function = rexmit_timer;
+	d->timer.function = (TIMER_FUNC_TYPE)rexmit_timer;
 
 	skb = skb_clone(skb, GFP_ATOMIC);
 	if (skb) {
diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c
index b28fefb90391..697f735b07a4 100644
--- a/drivers/block/aoe/aoedev.c
+++ b/drivers/block/aoe/aoedev.c
@@ -15,7 +15,6 @@
 #include <linux/string.h>
 #include "aoe.h"
 
-static void dummy_timer(ulong);
 static void freetgt(struct aoedev *d, struct aoetgt *t);
 static void skbpoolfree(struct aoedev *d);
 
@@ -146,11 +145,11 @@ aoedev_put(struct aoedev *d)
 }
 
 static void
-dummy_timer(ulong vp)
+dummy_timer(struct timer_list *t)
 {
 	struct aoedev *d;
 
-	d = (struct aoedev *)vp;
+	d = from_timer(d, t, timer);
 	if (d->flags & DEVFL_TKILL)
 		return;
 	d->timer.expires = jiffies + HZ;
@@ -466,9 +465,7 @@ aoedev_by_aoeaddr(ulong maj, int min, int do_alloc)
 	INIT_WORK(&d->work, aoecmd_sleepwork);
 	spin_lock_init(&d->lock);
 	skb_queue_head_init(&d->skbpool);
-	init_timer(&d->timer);
-	d->timer.data = (ulong) d;
-	d->timer.function = dummy_timer;
+	timer_setup(&d->timer, dummy_timer, 0);
 	d->timer.expires = jiffies + HZ;
 	add_timer(&d->timer);
 	d->bufpool = NULL;	/* defer to aoeblk_gdalloc */
-- 
2.7.4


-- 
Kees Cook
Pixel Security

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] block/aoe: Convert timers to use timer_setup()
  2017-10-05 23:13 [PATCH v2] block/aoe: Convert timers to use timer_setup() Kees Cook
@ 2017-10-06 14:19 ` Jens Axboe
  2017-10-17  0:03   ` Kees Cook
  0 siblings, 1 reply; 5+ messages in thread
From: Jens Axboe @ 2017-10-06 14:19 UTC (permalink / raw)
  To: Kees Cook; +Cc: linux-kernel, Ed L. Cashin, linux-block, Thomas Gleixner

On 10/05/2017 05:13 PM, Kees Cook wrote:
> In preparation for unconditionally passing the struct timer_list pointer to
> all timer callbacks, switch to using the new timer_setup() and from_timer()
> to pass the timer pointer explicitly.

Applied to for-4.15/timer

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] block/aoe: Convert timers to use timer_setup()
  2017-10-06 14:19 ` Jens Axboe
@ 2017-10-17  0:03   ` Kees Cook
  2017-10-17 16:09     ` Jens Axboe
  0 siblings, 1 reply; 5+ messages in thread
From: Kees Cook @ 2017-10-17  0:03 UTC (permalink / raw)
  To: Jens Axboe; +Cc: LKML, Ed L. Cashin, linux-block, Thomas Gleixner

On Fri, Oct 6, 2017 at 7:19 AM, Jens Axboe <axboe@kernel.dk> wrote:
> On 10/05/2017 05:13 PM, Kees Cook wrote:
>> In preparation for unconditionally passing the struct timer_list pointer to
>> all timer callbacks, switch to using the new timer_setup() and from_timer()
>> to pass the timer pointer explicitly.
>
> Applied to for-4.15/timer

Hi,

I just wanted to check what your timer plans were for merging this
into -next (I'm doing rebasing to find out which maintainers I need to
resend patches to, and I noticed block hasn't appeared in -next, but I
know you've pulled patches...)

Thanks!

-Kees

-- 
Kees Cook
Pixel Security

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] block/aoe: Convert timers to use timer_setup()
  2017-10-17  0:03   ` Kees Cook
@ 2017-10-17 16:09     ` Jens Axboe
  2017-10-17 16:21       ` Jens Axboe
  0 siblings, 1 reply; 5+ messages in thread
From: Jens Axboe @ 2017-10-17 16:09 UTC (permalink / raw)
  To: Kees Cook; +Cc: LKML, Ed L. Cashin, linux-block, Thomas Gleixner

On 10/16/2017 06:03 PM, Kees Cook wrote:
> On Fri, Oct 6, 2017 at 7:19 AM, Jens Axboe <axboe@kernel.dk> wrote:
>> On 10/05/2017 05:13 PM, Kees Cook wrote:
>>> In preparation for unconditionally passing the struct timer_list pointer to
>>> all timer callbacks, switch to using the new timer_setup() and from_timer()
>>> to pass the timer pointer explicitly.
>>
>> Applied to for-4.15/timer
> 
> Hi,
> 
> I just wanted to check what your timer plans were for merging this
> into -next (I'm doing rebasing to find out which maintainers I need to
> resend patches to, and I noticed block hasn't appeared in -next, but I
> know you've pulled patches...)

It should be in for-next, since I wrote that email. It's in my
for-4.15/timer branch, which is also merged into my for-next branch
(which is the one that Stephen pulls).

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] block/aoe: Convert timers to use timer_setup()
  2017-10-17 16:09     ` Jens Axboe
@ 2017-10-17 16:21       ` Jens Axboe
  0 siblings, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2017-10-17 16:21 UTC (permalink / raw)
  To: Kees Cook; +Cc: LKML, Ed L. Cashin, linux-block, Thomas Gleixner

On 10/17/2017 10:09 AM, Jens Axboe wrote:
> On 10/16/2017 06:03 PM, Kees Cook wrote:
>> On Fri, Oct 6, 2017 at 7:19 AM, Jens Axboe <axboe@kernel.dk> wrote:
>>> On 10/05/2017 05:13 PM, Kees Cook wrote:
>>>> In preparation for unconditionally passing the struct timer_list pointer to
>>>> all timer callbacks, switch to using the new timer_setup() and from_timer()
>>>> to pass the timer pointer explicitly.
>>>
>>> Applied to for-4.15/timer
>>
>> Hi,
>>
>> I just wanted to check what your timer plans were for merging this
>> into -next (I'm doing rebasing to find out which maintainers I need to
>> resend patches to, and I noticed block hasn't appeared in -next, but I
>> know you've pulled patches...)
> 
> It should be in for-next, since I wrote that email. It's in my
> for-4.15/timer branch, which is also merged into my for-next branch
> (which is the one that Stephen pulls).

Just pulled in for-next, and it seems to contain what it should.
If you see missing block related timer patches in for-next, then
they haven't been applied to my tree yet.

axboe@dell:[.]home/axboe/git/linux-next $ git log drivers/block/aoe/
commit a79c192c7cdb639ad1b059cedbf3dfa68427a170
Author: Kees Cook <keescook@chromium.org>
Date:   Thu Oct 5 16:13:54 2017 -0700

    block/aoe: Convert timers to use timer_setup()
[...]

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-10-17 16:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-05 23:13 [PATCH v2] block/aoe: Convert timers to use timer_setup() Kees Cook
2017-10-06 14:19 ` Jens Axboe
2017-10-17  0:03   ` Kees Cook
2017-10-17 16:09     ` Jens Axboe
2017-10-17 16:21       ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.