From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752381AbbCaTC6 (ORCPT ); Tue, 31 Mar 2015 15:02:58 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:53120 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751413AbbCaTC5 (ORCPT ); Tue, 31 Mar 2015 15:02:57 -0400 Message-ID: <551AEF56.4070504@roeck-us.net> Date: Tue, 31 Mar 2015 12:02:46 -0700 From: Guenter Roeck User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Andrew Bresticker , Wim Van Sebroeck CC: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, Naidu Tellapati , Ezequiel Garcia Subject: Re: [PATCH 2/4] watchdog: imgpdc: Intialize timeout to default value References: <1427827751-19705-1-git-send-email-abrestic@chromium.org> <1427827751-19705-2-git-send-email-abrestic@chromium.org> In-Reply-To: <1427827751-19705-2-git-send-email-abrestic@chromium.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated_sender: linux@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-CTCH-PVer: 0000001 X-CTCH-Spam: Unknown X-CTCH-VOD: Unknown X-CTCH-Flags: 0 X-CTCH-RefID: str=0001.0A020202.551AEF60.0367,ss=1,re=0.001,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 X-CTCH-Score: 0.001 X-CTCH-ScoreCust: 0.000 X-CTCH-Rules: C_4847, X-CTCH-SenderID: linux@roeck-us.net X-CTCH-SenderID-Flags: 0 X-CTCH-SenderID-TotalMessages: 3 X-CTCH-SenderID-TotalSpam: 0 X-CTCH-SenderID-TotalSuspected: 0 X-CTCH-SenderID-TotalConfirmed: 0 X-CTCH-SenderID-TotalBulk: 0 X-CTCH-SenderID-TotalVirus: 0 X-CTCH-SenderID-TotalRecipients: 0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: mailgid no entry from get_relayhosts_entry X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/31/2015 11:49 AM, Andrew Bresticker wrote: > From: Naidu Tellapati > > Currently the watchdog timeout is initialized to 0. Initialize it to > its default value instead. > > Signed-off-by: Naidu Tellapati > Signed-off-by: Andrew Bresticker > Cc: Ezequiel Garcia > --- > drivers/watchdog/imgpdc_wdt.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/watchdog/imgpdc_wdt.c b/drivers/watchdog/imgpdc_wdt.c > index c4151cd..f3f65ac 100644 > --- a/drivers/watchdog/imgpdc_wdt.c > +++ b/drivers/watchdog/imgpdc_wdt.c > @@ -42,7 +42,7 @@ > #define PDC_WDT_MIN_TIMEOUT 1 > #define PDC_WDT_DEF_TIMEOUT 64 > > -static int heartbeat; > +static int heartbeat = PDC_WDT_DEF_TIMEOUT; > module_param(heartbeat, int, 0); > MODULE_PARM_DESC(heartbeat, "Watchdog heartbeats in seconds. " > "(default = " __MODULE_STRING(PDC_WDT_DEF_TIMEOUT) ")"); > The idea with watchdog_init_timeout() is that it can take the timeout from devicetree unless the module parameter is provided. By pre-initializing the module parameter, you defeat that and make watchdog_init_timeout more or less a no-op. You might as well set pdc_wdt->wdt_dev.timeout directly and not call watchdog_init_timeout at all if that is what you want. The "expected" solution would be to pre-initialize pdc_wdt->wdt_dev.timeout but leave the module parameter alone. Guenter