linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Tomer Maimon <tmaimon77@gmail.com>
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Joel Stanley <joel@jms.id.au>,
	Avi Fishman <avifishman70@gmail.com>,
	Tali Perry <tali.perry1@gmail.com>, Nancy Yuen <yuenn@google.com>,
	Benjamin Fair <benjaminfair@google.com>,
	linux-watchdog@vger.kernel.org,
	devicetree <devicetree@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	OpenBMC Maillist <openbmc@lists.ozlabs.org>
Subject: Re: [PATCH v2 3/3] watchdog: npcm: remove whitespaces
Date: Wed, 4 Mar 2020 09:02:45 -0800	[thread overview]
Message-ID: <20200304170245.GA22851@roeck-us.net> (raw)
In-Reply-To: <CAP6Zq1gW53NEH7vD9C9GK2sg1pOxeZinA5uMJQQmbntrf=2ySA@mail.gmail.com>

On Wed, Mar 04, 2020 at 10:18:12AM +0200, Tomer Maimon wrote:
> Hi Guenter,
> 
> I still see the whitespaces warning in v5.6-rc4
> 
> https://github.com/torvalds/linux/blob/master/drivers/watchdog/npcm_wdt.c#L106
> 
You are corerct, sorry. No idea what I looked at yesterday.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> 
> bash-4.2$ ./scripts/checkpatch.pl --strict --file
> drivers/watchdog/npcm_wdt.c
> CHECK: Please don't use multiple blank lines
> #106: FILE: drivers/watchdog/npcm_wdt.c:106:
> +
> +
> 
> WARNING: suspect code indent for conditional statements (8, 14)
> #112: FILE: drivers/watchdog/npcm_wdt.c:112:
> + else if (timeout < 3)
> +      wdd->timeout = 2;
> 
> WARNING: suspect code indent for conditional statements (8, 14)
> #114: FILE: drivers/watchdog/npcm_wdt.c:114:
> + else if (timeout < 6)
> +      wdd->timeout = 5;
> 
> WARNING: suspect code indent for conditional statements (8, 14)
> #116: FILE: drivers/watchdog/npcm_wdt.c:116:
> + else if (timeout < 11)
> +      wdd->timeout = 10;
> 
> WARNING: suspect code indent for conditional statements (8, 14)
> #118: FILE: drivers/watchdog/npcm_wdt.c:118:
> + else if (timeout < 22)
> +      wdd->timeout = 21;
> 
> WARNING: suspect code indent for conditional statements (8, 14)
> #120: FILE: drivers/watchdog/npcm_wdt.c:120:
> + else if (timeout < 44)
> +      wdd->timeout = 43;
> 
> WARNING: suspect code indent for conditional statements (8, 14)
> #122: FILE: drivers/watchdog/npcm_wdt.c:122:
> + else if (timeout < 87)
> +      wdd->timeout = 86;
> 
> WARNING: suspect code indent for conditional statements (8, 14)
> #124: FILE: drivers/watchdog/npcm_wdt.c:124:
> + else if (timeout < 173)
> +      wdd->timeout = 172;
> 
> WARNING: suspect code indent for conditional statements (8, 14)
> #126: FILE: drivers/watchdog/npcm_wdt.c:126:
> + else if (timeout < 688)
> +      wdd->timeout = 687;
> 
> WARNING: suspect code indent for conditional statements (8, 14)
> #128: FILE: drivers/watchdog/npcm_wdt.c:128:
> + else
> +      wdd->timeout = 2750;
> 
> Thanks,
> 
> Tomer
> 
> On Tue, 3 Mar 2020 at 23:25, Guenter Roeck <linux@roeck-us.net> wrote:
> 
> > On Tue, Mar 03, 2020 at 12:01:14PM +0200, Tomer Maimon wrote:
> > > Signed-off-by: Tomer Maimon <tmaimon77@gmail.com>
> >
> > Turns out this problem does not actually exist in the upstream driver
> > (as of v5.6-rc4). You might want to align your code with the upstream
> > kernel.
> >
> > Guenter
> >
> > > ---
> > >  drivers/watchdog/npcm_wdt.c | 19 +++++++++----------
> > >  1 file changed, 9 insertions(+), 10 deletions(-)
> > >
> > > diff --git a/drivers/watchdog/npcm_wdt.c b/drivers/watchdog/npcm_wdt.c
> > > index 84a728af6664..bd38bf1ee6a1 100644
> > > --- a/drivers/watchdog/npcm_wdt.c
> > > +++ b/drivers/watchdog/npcm_wdt.c
> > > @@ -123,30 +123,29 @@ static int npcm_wdt_stop(struct watchdog_device
> > *wdd)
> > >       return 0;
> > >  }
> > >
> > > -
> > >  static int npcm_wdt_set_timeout(struct watchdog_device *wdd,
> > >                               unsigned int timeout)
> > >  {
> > >       if (timeout < 2)
> > >               wdd->timeout = 1;
> > >       else if (timeout < 3)
> > > -           wdd->timeout = 2;
> > > +             wdd->timeout = 2;
> > >       else if (timeout < 6)
> > > -           wdd->timeout = 5;
> > > +             wdd->timeout = 5;
> > >       else if (timeout < 11)
> > > -           wdd->timeout = 10;
> > > +             wdd->timeout = 10;
> > >       else if (timeout < 22)
> > > -           wdd->timeout = 21;
> > > +             wdd->timeout = 21;
> > >       else if (timeout < 44)
> > > -           wdd->timeout = 43;
> > > +             wdd->timeout = 43;
> > >       else if (timeout < 87)
> > > -           wdd->timeout = 86;
> > > +             wdd->timeout = 86;
> > >       else if (timeout < 173)
> > > -           wdd->timeout = 172;
> > > +             wdd->timeout = 172;
> > >       else if (timeout < 688)
> > > -           wdd->timeout = 687;
> > > +             wdd->timeout = 687;
> > >       else
> > > -           wdd->timeout = 2750;
> > > +             wdd->timeout = 2750;
> > >
> > >       if (watchdog_active(wdd))
> > >               npcm_wdt_start(wdd);
> >

      parent reply	other threads:[~2020-03-04 17:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-03 10:01 [PATCH v2 0/3] watchdog: npcm: add last bootstatus support Tomer Maimon
2020-03-03 10:01 ` [PATCH v2 1/3] dt-binding: watchdog: add bootstatus reset type documentation Tomer Maimon
2020-03-04 17:08   ` Guenter Roeck
2020-03-03 10:01 ` [PATCH v2 2/3] watchdog: npcm: sets card ext1 and ext2 bootstatus during probe Tomer Maimon
2020-03-03 10:01 ` [PATCH v2 3/3] watchdog: npcm: remove whitespaces Tomer Maimon
2020-03-03 21:25   ` Guenter Roeck
     [not found]     ` <CAP6Zq1gW53NEH7vD9C9GK2sg1pOxeZinA5uMJQQmbntrf=2ySA@mail.gmail.com>
2020-03-04 17:02       ` Guenter Roeck [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200304170245.GA22851@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=avifishman70@gmail.com \
    --cc=benjaminfair@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=joel@jms.id.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=openbmc@lists.ozlabs.org \
    --cc=robh+dt@kernel.org \
    --cc=tali.perry1@gmail.com \
    --cc=tmaimon77@gmail.com \
    --cc=wim@linux-watchdog.org \
    --cc=yuenn@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).