* [PATCH] video: fbdev: pxa3xx_gcu: Convert timers to use timer_setup() @ 2017-11-09 18:48 ` Kees Cook 0 siblings, 0 replies; 5+ messages in thread From: Kees Cook @ 2017-11-09 18:48 UTC (permalink / raw) To: Bartlomiej Zolnierkiewicz Cc: Gustavo A. R. Silva, Himanshu Jha, dri-devel, linux-fbdev, linux-kernel 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. This also fixes the use of the "priv" variable in QERROR(), since it was pointing to struct timer_list, not struct pxa3xx_gcu_priv. Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com> Cc: Himanshu Jha <himanshujha199640@gmail.com> Cc: dri-devel@lists.freedesktop.org Cc: linux-fbdev@vger.kernel.org Signed-off-by: Kees Cook <keescook@chromium.org> --- If you can take this for v4.15, please do. Otherwise, I can carry it in the timers tree in late rc1. Thanks! --- drivers/video/fbdev/pxa3xx-gcu.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/video/fbdev/pxa3xx-gcu.c b/drivers/video/fbdev/pxa3xx-gcu.c index 164fb524744a..208cd5a5e15c 100644 --- a/drivers/video/fbdev/pxa3xx-gcu.c +++ b/drivers/video/fbdev/pxa3xx-gcu.c @@ -512,24 +512,26 @@ pxa3xx_gcu_mmap(struct file *file, struct vm_area_struct *vma) #ifdef PXA3XX_GCU_DEBUG_TIMER static struct timer_list pxa3xx_gcu_debug_timer; +static struct pxa3xx_gcu_priv *debug_timer_priv; -static void pxa3xx_gcu_debug_timedout(unsigned long ptr) +static void pxa3xx_gcu_debug_timedout(struct timer_list *unused) { - struct pxa3xx_gcu_priv *priv = (struct pxa3xx_gcu_priv *) ptr; + struct pxa3xx_gcu_priv *priv = debug_timer_priv; QERROR("Timer DUMP"); - /* init the timer structure */ - setup_timer(&pxa3xx_gcu_debug_timer, pxa3xx_gcu_debug_timedout, ptr); mod_timer(&pxa3xx_gcu_debug_timer, jiffies + 5 * HZ); } -static void pxa3xx_gcu_init_debug_timer(void) +static void pxa3xx_gcu_init_debug_timer(struct pxa3xx_gcu_priv *priv) { - pxa3xx_gcu_debug_timedout((unsigned long) &pxa3xx_gcu_debug_timer); + /* init the timer structure */ + debug_timer_priv = priv; + timer_setup(&pxa3xx_gcu_debug_timer, pxa3xx_gcu_debug_timedout, 0); + pxa3xx_gcu_debug_timedout(NULL); } #else -static inline void pxa3xx_gcu_init_debug_timer(void) {} +static inline void pxa3xx_gcu_init_debug_timer(struct pxa3xx_gcu_priv *) {} #endif static int @@ -666,7 +668,7 @@ static int pxa3xx_gcu_probe(struct platform_device *pdev) platform_set_drvdata(pdev, priv); priv->resource_mem = r; pxa3xx_gcu_reset(priv); - pxa3xx_gcu_init_debug_timer(); + pxa3xx_gcu_init_debug_timer(priv); dev_info(dev, "registered @0x%p, DMA 0x%p (%d bytes), IRQ %d\n", (void *) r->start, (void *) priv->shared_phys, -- 2.7.4 -- Kees Cook Pixel Security ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] video: fbdev: pxa3xx_gcu: Convert timers to use timer_setup() @ 2017-11-09 18:48 ` Kees Cook 0 siblings, 0 replies; 5+ messages in thread From: Kees Cook @ 2017-11-09 18:48 UTC (permalink / raw) To: Bartlomiej Zolnierkiewicz Cc: Gustavo A. R. Silva, Himanshu Jha, dri-devel, linux-fbdev, linux-kernel 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. This also fixes the use of the "priv" variable in QERROR(), since it was pointing to struct timer_list, not struct pxa3xx_gcu_priv. Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com> Cc: Himanshu Jha <himanshujha199640@gmail.com> Cc: dri-devel@lists.freedesktop.org Cc: linux-fbdev@vger.kernel.org Signed-off-by: Kees Cook <keescook@chromium.org> --- If you can take this for v4.15, please do. Otherwise, I can carry it in the timers tree in late rc1. Thanks! --- drivers/video/fbdev/pxa3xx-gcu.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/video/fbdev/pxa3xx-gcu.c b/drivers/video/fbdev/pxa3xx-gcu.c index 164fb524744a..208cd5a5e15c 100644 --- a/drivers/video/fbdev/pxa3xx-gcu.c +++ b/drivers/video/fbdev/pxa3xx-gcu.c @@ -512,24 +512,26 @@ pxa3xx_gcu_mmap(struct file *file, struct vm_area_struct *vma) #ifdef PXA3XX_GCU_DEBUG_TIMER static struct timer_list pxa3xx_gcu_debug_timer; +static struct pxa3xx_gcu_priv *debug_timer_priv; -static void pxa3xx_gcu_debug_timedout(unsigned long ptr) +static void pxa3xx_gcu_debug_timedout(struct timer_list *unused) { - struct pxa3xx_gcu_priv *priv = (struct pxa3xx_gcu_priv *) ptr; + struct pxa3xx_gcu_priv *priv = debug_timer_priv; QERROR("Timer DUMP"); - /* init the timer structure */ - setup_timer(&pxa3xx_gcu_debug_timer, pxa3xx_gcu_debug_timedout, ptr); mod_timer(&pxa3xx_gcu_debug_timer, jiffies + 5 * HZ); } -static void pxa3xx_gcu_init_debug_timer(void) +static void pxa3xx_gcu_init_debug_timer(struct pxa3xx_gcu_priv *priv) { - pxa3xx_gcu_debug_timedout((unsigned long) &pxa3xx_gcu_debug_timer); + /* init the timer structure */ + debug_timer_priv = priv; + timer_setup(&pxa3xx_gcu_debug_timer, pxa3xx_gcu_debug_timedout, 0); + pxa3xx_gcu_debug_timedout(NULL); } #else -static inline void pxa3xx_gcu_init_debug_timer(void) {} +static inline void pxa3xx_gcu_init_debug_timer(struct pxa3xx_gcu_priv *) {} #endif static int @@ -666,7 +668,7 @@ static int pxa3xx_gcu_probe(struct platform_device *pdev) platform_set_drvdata(pdev, priv); priv->resource_mem = r; pxa3xx_gcu_reset(priv); - pxa3xx_gcu_init_debug_timer(); + pxa3xx_gcu_init_debug_timer(priv); dev_info(dev, "registered @0x%p, DMA 0x%p (%d bytes), IRQ %d\n", (void *) r->start, (void *) priv->shared_phys, -- 2.7.4 -- Kees Cook Pixel Security ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] video: fbdev: pxa3xx_gcu: Convert timers to use timer_setup() 2017-11-09 18:48 ` Kees Cook (?) @ 2017-11-10 15:31 ` Bartlomiej Zolnierkiewicz -1 siblings, 0 replies; 5+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2017-11-10 15:31 UTC (permalink / raw) To: Kees Cook Cc: linux-kernel, linux-fbdev, Himanshu Jha, dri-devel, Gustavo A. R. Silva On Thursday, November 09, 2017 10:48:40 AM 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. > > This also fixes the use of the "priv" variable in QERROR(), since it was > pointing to struct timer_list, not struct pxa3xx_gcu_priv. > > Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> > Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com> > Cc: Himanshu Jha <himanshujha199640@gmail.com> > Cc: dri-devel@lists.freedesktop.org > Cc: linux-fbdev@vger.kernel.org > Signed-off-by: Kees Cook <keescook@chromium.org> > --- > If you can take this for v4.15, please do. Otherwise, I can carry it in the > timers tree in late rc1. Thanks! Thanks, I queued this for v4.15 with a trivial fix for: > #else > -static inline void pxa3xx_gcu_init_debug_timer(void) {} > +static inline void pxa3xx_gcu_init_debug_timer(struct pxa3xx_gcu_priv *) {} > #endif which caused: drivers/video/fbdev/pxa3xx-gcu.c: In function ‘pxa3xx_gcu_init_debug_timer’: drivers/video/fbdev/pxa3xx-gcu.c:534:133: error: parameter name omitted make[3]: *** [drivers/video/fbdev/pxa3xx-gcu.o] Error 1 make[3]: *** Waiting for unfinished jobs.... for the non-debug case. I also queued the original fbdev conversion patch on top of this one. Best regards, -- Bartlomiej Zolnierkiewicz Samsung R&D Institute Poland Samsung Electronics ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] video: fbdev: pxa3xx_gcu: Convert timers to use timer_setup() @ 2017-11-10 15:31 ` Bartlomiej Zolnierkiewicz 0 siblings, 0 replies; 5+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2017-11-10 15:31 UTC (permalink / raw) To: Kees Cook Cc: Gustavo A. R. Silva, Himanshu Jha, dri-devel, linux-fbdev, linux-kernel On Thursday, November 09, 2017 10:48:40 AM 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. > > This also fixes the use of the "priv" variable in QERROR(), since it was > pointing to struct timer_list, not struct pxa3xx_gcu_priv. > > Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> > Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com> > Cc: Himanshu Jha <himanshujha199640@gmail.com> > Cc: dri-devel@lists.freedesktop.org > Cc: linux-fbdev@vger.kernel.org > Signed-off-by: Kees Cook <keescook@chromium.org> > --- > If you can take this for v4.15, please do. Otherwise, I can carry it in the > timers tree in late rc1. Thanks! Thanks, I queued this for v4.15 with a trivial fix for: > #else > -static inline void pxa3xx_gcu_init_debug_timer(void) {} > +static inline void pxa3xx_gcu_init_debug_timer(struct pxa3xx_gcu_priv *) {} > #endif which caused: drivers/video/fbdev/pxa3xx-gcu.c: In function ‘pxa3xx_gcu_init_debug_timer’: drivers/video/fbdev/pxa3xx-gcu.c:534:133: error: parameter name omitted make[3]: *** [drivers/video/fbdev/pxa3xx-gcu.o] Error 1 make[3]: *** Waiting for unfinished jobs.... for the non-debug case. I also queued the original fbdev conversion patch on top of this one. Best regards, -- Bartlomiej Zolnierkiewicz Samsung R&D Institute Poland Samsung Electronics ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] video: fbdev: pxa3xx_gcu: Convert timers to use timer_setup() @ 2017-11-10 15:31 ` Bartlomiej Zolnierkiewicz 0 siblings, 0 replies; 5+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2017-11-10 15:31 UTC (permalink / raw) To: Kees Cook Cc: linux-kernel, linux-fbdev, Himanshu Jha, dri-devel, Gustavo A. R. Silva On Thursday, November 09, 2017 10:48:40 AM 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. > > This also fixes the use of the "priv" variable in QERROR(), since it was > pointing to struct timer_list, not struct pxa3xx_gcu_priv. > > Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> > Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com> > Cc: Himanshu Jha <himanshujha199640@gmail.com> > Cc: dri-devel@lists.freedesktop.org > Cc: linux-fbdev@vger.kernel.org > Signed-off-by: Kees Cook <keescook@chromium.org> > --- > If you can take this for v4.15, please do. Otherwise, I can carry it in the > timers tree in late rc1. Thanks! Thanks, I queued this for v4.15 with a trivial fix for: > #else > -static inline void pxa3xx_gcu_init_debug_timer(void) {} > +static inline void pxa3xx_gcu_init_debug_timer(struct pxa3xx_gcu_priv *) {} > #endif which caused: drivers/video/fbdev/pxa3xx-gcu.c: In function ‘pxa3xx_gcu_init_debug_timer’: drivers/video/fbdev/pxa3xx-gcu.c:534:133: error: parameter name omitted make[3]: *** [drivers/video/fbdev/pxa3xx-gcu.o] Error 1 make[3]: *** Waiting for unfinished jobs.... for the non-debug case. I also queued the original fbdev conversion patch on top of this one. Best regards, -- Bartlomiej Zolnierkiewicz Samsung R&D Institute Poland Samsung Electronics _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-11-10 15:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20171109184844epcas3p2cce92ea7c58b3a517914b069013a08d0@epcas3p2.samsung.com>
2017-11-09 18:48 ` [PATCH] video: fbdev: pxa3xx_gcu: Convert timers to use timer_setup() Kees Cook
2017-11-09 18:48 ` Kees Cook
2017-11-10 15:31 ` Bartlomiej Zolnierkiewicz
2017-11-10 15:31 ` Bartlomiej Zolnierkiewicz
2017-11-10 15:31 ` Bartlomiej Zolnierkiewicz
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.