Re: [v8,4/5] watchdog: Add RAVE SP watchdog driver

From: Joe Perches
Date: Sat Oct 21 2017 - 19:34:44 EST


On Sat, 2017-10-21 at 09:47 -0700, Guenter Roeck wrote:
> On Wed, Oct 18, 2017 at 10:01:35AM -0700, Andrey Smirnov wrote:
> > This driver provides access to RAVE SP watchdog functionality.
[]
> > +static int rave_sp_wdt_legacy_configure(struct watchdog_device *wdd)
> > +{
> > + const bool enable = watchdog_hw_running(wdd);
> > + u8 cmd[] = {
> > + [0] = RAVE_SP_CMD_SW_WDT,
> > + [1] = 0,
> > + [2] = 0,
> > + [3] = !!enable,
>
> Useless !!. It converts a boolean to a boolean. Besides, isn't it always
> true anyway ?

This converts a _Bool to an int which is cast to a u8
The !! is useless though.

> > + [4] = enable ? wdd->timeout : 0,
> > + };
>
> Interesting; checkpatch doesn't require an empty line after variable
> declarations anymore ? Lets keep it anyway for consistency.

checkpatch is primarily a single line oriented parser.
Multi-line declarations aren't parsed.