[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171030100838.lvjxy3o6q227kjsn@phenom.ffwll.local>
Date: Mon, 30 Oct 2017 11:08:38 +0100
From: Daniel Vetter <daniel@...ll.ch>
To: Kees Cook <keescook@...omium.org>
Cc: Patrik Jakobsson <patrik.r.jakobsson@...il.com>,
linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org
Subject: Re: [PATCH] drm: gma500: Convert timers to use timer_setup()
On Tue, Oct 24, 2017 at 08:16:09AM -0700, 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.
>
> Cc: Patrik Jakobsson <patrik.r.jakobsson@...il.com>
> Cc: David Airlie <airlied@...ux.ie>
> Cc: dri-devel@...ts.freedesktop.org
> Signed-off-by: Kees Cook <keescook@...omium.org>
Do you expect drm folks to apply this, or is this part of a larger refactoring?
A notch more context in the commit message would help ...
-Daniel
> ---
> drivers/gpu/drm/gma500/psb_lid.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/gma500/psb_lid.c b/drivers/gpu/drm/gma500/psb_lid.c
> index 1d2ebb5e530f..be6dda58fcae 100644
> --- a/drivers/gpu/drm/gma500/psb_lid.c
> +++ b/drivers/gpu/drm/gma500/psb_lid.c
> @@ -23,9 +23,9 @@
> #include "psb_intel_reg.h"
> #include <linux/spinlock.h>
>
> -static void psb_lid_timer_func(unsigned long data)
> +static void psb_lid_timer_func(struct timer_list *t)
> {
> - struct drm_psb_private * dev_priv = (struct drm_psb_private *)data;
> + struct drm_psb_private *dev_priv = from_timer(dev_priv, t, lid_timer);
> struct drm_device *dev = (struct drm_device *)dev_priv->dev;
> struct timer_list *lid_timer = &dev_priv->lid_timer;
> unsigned long irq_flags;
> @@ -77,10 +77,8 @@ void psb_lid_timer_init(struct drm_psb_private *dev_priv)
> spin_lock_init(&dev_priv->lid_lock);
> spin_lock_irqsave(&dev_priv->lid_lock, irq_flags);
>
> - init_timer(lid_timer);
> + timer_setup(lid_timer, psb_lid_timer_func, 0);
>
> - lid_timer->data = (unsigned long)dev_priv;
> - lid_timer->function = psb_lid_timer_func;
> lid_timer->expires = jiffies + PSB_LID_DELAY;
>
> add_timer(lid_timer);
> --
> 2.7.4
>
>
> --
> Kees Cook
> Pixel Security
> _______________________________________________
> dri-devel mailing list
> dri-devel@...ts.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Powered by blists - more mailing lists