* [PATCH] s390: qdio: Convert timers to use timer_setup()
@ 2017-10-05 0:54 Kees Cook
2017-10-05 9:13 ` Sebastian Ott
0 siblings, 1 reply; 4+ messages in thread
From: Kees Cook @ 2017-10-05 0:54 UTC (permalink / raw)
To: linux-kernel
Cc: Sebastian Ott, Peter Oberparleiter, Martin Schwidefsky,
Heiko Carstens, linux-s390, 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: Sebastian Ott <sebott@linux.vnet.ibm.com>
Cc: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: linux-s390@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kees Cook <keescook@chromium.org>
---
This requires commit 686fef928bba ("timer: Prepare to change timer
callback argument type") in v4.14-rc3, but should be otherwise
stand-alone.
---
drivers/s390/cio/qdio.h | 2 +-
drivers/s390/cio/qdio_main.c | 4 ++--
drivers/s390/cio/qdio_setup.c | 3 +--
3 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/s390/cio/qdio.h b/drivers/s390/cio/qdio.h
index 7e70f9298cc1..a99bbd21c793 100644
--- a/drivers/s390/cio/qdio.h
+++ b/drivers/s390/cio/qdio.h
@@ -392,7 +392,7 @@ int test_nonshared_ind(struct qdio_irq *);
/* prototypes for setup */
void qdio_inbound_processing(unsigned long data);
void qdio_outbound_processing(unsigned long data);
-void qdio_outbound_timer(unsigned long data);
+void qdio_outbound_timer(struct timer_list *t);
void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm,
struct irb *irb);
int qdio_allocate_qs(struct qdio_irq *irq_ptr, int nr_input_qs,
diff --git a/drivers/s390/cio/qdio_main.c b/drivers/s390/cio/qdio_main.c
index a4ad39ba3873..86b8a474b9a2 100644
--- a/drivers/s390/cio/qdio_main.c
+++ b/drivers/s390/cio/qdio_main.c
@@ -894,9 +894,9 @@ void qdio_outbound_processing(unsigned long data)
__qdio_outbound_processing(q);
}
-void qdio_outbound_timer(unsigned long data)
+void qdio_outbound_timer(struct timer_list *t)
{
- struct qdio_q *q = (struct qdio_q *)data;
+ struct qdio_q *q = from_timer(q, t, o.out.timer);
qdio_tasklet_schedule(q);
}
diff --git a/drivers/s390/cio/qdio_setup.c b/drivers/s390/cio/qdio_setup.c
index 48b3866a9ded..9ae1380cbc31 100644
--- a/drivers/s390/cio/qdio_setup.c
+++ b/drivers/s390/cio/qdio_setup.c
@@ -252,8 +252,7 @@ static void setup_queues(struct qdio_irq *irq_ptr,
tasklet_init(&q->tasklet, qdio_outbound_processing,
(unsigned long) q);
- setup_timer(&q->u.out.timer, (void(*)(unsigned long))
- &qdio_outbound_timer, (unsigned long)q);
+ timer_setup(&q->u.out.timer, qdio_outbound_timer, 0);
}
}
--
2.7.4
--
Kees Cook
Pixel Security
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] s390: qdio: Convert timers to use timer_setup()
2017-10-05 0:54 [PATCH] s390: qdio: Convert timers to use timer_setup() Kees Cook
@ 2017-10-05 9:13 ` Sebastian Ott
2017-10-05 16:58 ` Kees Cook
0 siblings, 1 reply; 4+ messages in thread
From: Sebastian Ott @ 2017-10-05 9:13 UTC (permalink / raw)
To: Kees Cook
Cc: linux-kernel, Peter Oberparleiter, Martin Schwidefsky,
Heiko Carstens, linux-s390, Thomas Gleixner
On Wed, 4 Oct 2017, 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.
> -void qdio_outbound_timer(unsigned long data)
> +void qdio_outbound_timer(struct timer_list *t)
> {
> - struct qdio_q *q = (struct qdio_q *)data;
> + struct qdio_q *q = from_timer(q, t, o.out.timer);
^
this should be u.out.timer
Will be applied to s390/linux.git
Thanks,
Sebastian
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] s390: qdio: Convert timers to use timer_setup()
2017-10-05 9:13 ` Sebastian Ott
@ 2017-10-05 16:58 ` Kees Cook
2017-10-05 17:06 ` Sebastian Ott
0 siblings, 1 reply; 4+ messages in thread
From: Kees Cook @ 2017-10-05 16:58 UTC (permalink / raw)
To: Sebastian Ott
Cc: LKML, Peter Oberparleiter, Martin Schwidefsky, Heiko Carstens,
linux-s390@vger.kernel.org, Thomas Gleixner
On Thu, Oct 5, 2017 at 2:13 AM, Sebastian Ott <sebott@linux.vnet.ibm.com> wrote:
> On Wed, 4 Oct 2017, 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.
>
>> -void qdio_outbound_timer(unsigned long data)
>> +void qdio_outbound_timer(struct timer_list *t)
>> {
>> - struct qdio_q *q = (struct qdio_q *)data;
>> + struct qdio_q *q = from_timer(q, t, o.out.timer);
> ^
> this should be u.out.timer
Oh thank you, good catch!
> Will be applied to s390/linux.git
Did you fix this up already or should I send a v2?
-Kees
--
Kees Cook
Pixel Security
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] s390: qdio: Convert timers to use timer_setup()
2017-10-05 16:58 ` Kees Cook
@ 2017-10-05 17:06 ` Sebastian Ott
0 siblings, 0 replies; 4+ messages in thread
From: Sebastian Ott @ 2017-10-05 17:06 UTC (permalink / raw)
To: Kees Cook
Cc: LKML, Peter Oberparleiter, Martin Schwidefsky, Heiko Carstens,
linux-s390@vger.kernel.org, Thomas Gleixner
On Thu, 5 Oct 2017, Kees Cook wrote:
> On Thu, Oct 5, 2017 at 2:13 AM, Sebastian Ott <sebott@linux.vnet.ibm.com> wrote:
> > On Wed, 4 Oct 2017, 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.
> >
> >> -void qdio_outbound_timer(unsigned long data)
> >> +void qdio_outbound_timer(struct timer_list *t)
> >> {
> >> - struct qdio_q *q = (struct qdio_q *)data;
> >> + struct qdio_q *q = from_timer(q, t, o.out.timer);
> > ^
> > this should be u.out.timer
>
> Oh thank you, good catch!
>
> > Will be applied to s390/linux.git
>
> Did you fix this up already or should I send a v2?
Already fixed, so no V2 needed.
Sebastian
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-10-05 17:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-05 0:54 [PATCH] s390: qdio: Convert timers to use timer_setup() Kees Cook
2017-10-05 9:13 ` Sebastian Ott
2017-10-05 16:58 ` Kees Cook
2017-10-05 17:06 ` Sebastian Ott
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).