From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932506AbdJYKix (ORCPT ); Wed, 25 Oct 2017 06:38:53 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:46274 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932378AbdJYKit (ORCPT ); Wed, 25 Oct 2017 06:38:49 -0400 X-Google-Smtp-Source: ABhQp+Qriq60o1A1RwD/HxG+mQe30f+8q91cKVLJSh/z2ZOTRrBknaf2asiPHMFax6WiSDwxb7dzCg== Subject: Re: [PATCH] watchdog: cpwd: Convert timers to use timer_setup() To: Kees Cook Cc: Wim Van Sebroeck , linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org References: <20171025103210.GA146019@beast> From: Guenter Roeck Message-ID: <55609d72-62c0-b76f-7117-055ae1db594f@roeck-us.net> Date: Wed, 25 Oct 2017 03:38:45 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171025103210.GA146019@beast> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/25/2017 03:32 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. Switches to using the global that is > used everywhere else. > > Cc: Wim Van Sebroeck > Cc: Guenter Roeck > Cc: linux-watchdog@vger.kernel.org > Signed-off-by: Kees Cook Reviewed-by: Guenter Roeck > --- > drivers/watchdog/cpwd.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/watchdog/cpwd.c b/drivers/watchdog/cpwd.c > index 3d43775548e5..aee0b25cf10d 100644 > --- a/drivers/watchdog/cpwd.c > +++ b/drivers/watchdog/cpwd.c > @@ -230,9 +230,9 @@ static void cpwd_resetbrokentimer(struct cpwd *p, int index) > * interrupts within the PLD so me must continually > * reset the timers ad infinitum. > */ > -static void cpwd_brokentimer(unsigned long data) > +static void cpwd_brokentimer(struct timer_list *unused) > { > - struct cpwd *p = (struct cpwd *) data; > + struct cpwd *p = cpwd_device; > int id, tripped = 0; > > /* kill a running timer instance, in case we > @@ -275,7 +275,7 @@ static void cpwd_stoptimer(struct cpwd *p, int index) > > if (p->broken) { > p->devs[index].runstatus |= WD_STAT_BSTOP; > - cpwd_brokentimer((unsigned long) p); > + cpwd_brokentimer(NULL); > } > } > } > @@ -608,7 +608,7 @@ static int cpwd_probe(struct platform_device *op) > } > > if (p->broken) { > - setup_timer(&cpwd_timer, cpwd_brokentimer, (unsigned long)p); > + timer_setup(&cpwd_timer, cpwd_brokentimer, 0); > cpwd_timer.expires = WD_BTIMEOUT; > > pr_info("PLD defect workaround enabled for model %s\n", >