From: Anatolij Gustschin <agust@denx.de>
To: Guenter Roeck <linux@roeck-us.net>
Cc: linux-watchdog@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Xiubo Li <Li.Xiubo@freescale.com>,
Shawn Guo <shawn.guo@linaro.org>,
Wolfram Sang <wsa@the-dreams.de>,
Wim Van Sebroeck <wim@iguana.be>
Subject: Re: [PATCH] watchdog: imx2_wdt: convert to watchdog core api
Date: Mon, 7 Apr 2014 23:30:13 +0200 [thread overview]
Message-ID: <20140407233013.7e4b5195@crub> (raw)
In-Reply-To: <20140407164811.GA28025@roeck-us.net>
On Mon, 7 Apr 2014 09:48:11 -0700
Guenter Roeck <linux@roeck-us.net> wrote:
...
> > + if (val & IMX2_WDT_WCR_WDE)
> > + return true;
> > + return false;
> > }
>
> You can simplyfy this to
>
> return val & IMX2_WDT_WCR_WDE;
>
> since C auto-converts from int to bool. If you feel fancy and don't
> trust the C compiler, another option would be
>
> return !!(val & IMX2_WDT_WCR_WDE);
>
> which would at least drop the if statement.
I'll simplify it, yes.
> [ ... ]
>
> > +
> > + wdog->timeout = clamp_t(unsigned, timeout, 1, IMX2_WDT_MAX_TIME);
> > + if (wdog->timeout != timeout)
> > dev_warn(&pdev->dev, "Initial timeout out of range! "
> > - "Clamped from %u to %u\n", timeout, imx2_wdt.timeout);
> > + "Clamped from %u to %u\n", timeout, wdog->timeout);
>
> Somewhat unrelated, but this results in a checkpatch warning.
> I would suggest to put the string in a single line.
>
> dev_warn(&pdev->dev,
> "Initial timeout out of range! Clamped from %u to %u\n",
> timeout, wdog->timeout);
okay, I'll fix the warning.
Thanks,
Anatolij
WARNING: multiple messages have this Message-ID (diff)
From: agust@denx.de (Anatolij Gustschin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] watchdog: imx2_wdt: convert to watchdog core api
Date: Mon, 7 Apr 2014 23:30:13 +0200 [thread overview]
Message-ID: <20140407233013.7e4b5195@crub> (raw)
In-Reply-To: <20140407164811.GA28025@roeck-us.net>
On Mon, 7 Apr 2014 09:48:11 -0700
Guenter Roeck <linux@roeck-us.net> wrote:
...
> > + if (val & IMX2_WDT_WCR_WDE)
> > + return true;
> > + return false;
> > }
>
> You can simplyfy this to
>
> return val & IMX2_WDT_WCR_WDE;
>
> since C auto-converts from int to bool. If you feel fancy and don't
> trust the C compiler, another option would be
>
> return !!(val & IMX2_WDT_WCR_WDE);
>
> which would at least drop the if statement.
I'll simplify it, yes.
> [ ... ]
>
> > +
> > + wdog->timeout = clamp_t(unsigned, timeout, 1, IMX2_WDT_MAX_TIME);
> > + if (wdog->timeout != timeout)
> > dev_warn(&pdev->dev, "Initial timeout out of range! "
> > - "Clamped from %u to %u\n", timeout, imx2_wdt.timeout);
> > + "Clamped from %u to %u\n", timeout, wdog->timeout);
>
> Somewhat unrelated, but this results in a checkpatch warning.
> I would suggest to put the string in a single line.
>
> dev_warn(&pdev->dev,
> "Initial timeout out of range! Clamped from %u to %u\n",
> timeout, wdog->timeout);
okay, I'll fix the warning.
Thanks,
Anatolij
next prev parent reply other threads:[~2014-04-07 21:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-05 18:29 [PATCH] watchdog: imx2_wdt: convert to watchdog core api Anatolij Gustschin
2014-04-05 18:29 ` Anatolij Gustschin
2014-04-07 16:48 ` Guenter Roeck
2014-04-07 16:48 ` Guenter Roeck
2014-04-07 21:30 ` Anatolij Gustschin [this message]
2014-04-07 21:30 ` Anatolij Gustschin
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=20140407233013.7e4b5195@crub \
--to=agust@denx.de \
--cc=Li.Xiubo@freescale.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=shawn.guo@linaro.org \
--cc=wim@iguana.be \
--cc=wsa@the-dreams.de \
/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 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.