public inbox for linux-watchdog@vger.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: <linux-watchdog@vger.kernel.org>,
	Wim Van Sebroeck <wim@iguana.be>,
	Lokesh Vutla <lokeshvutla@ti.com>, Felipe Balbi <balbi@ti.com>,
	<kernel@pengutronix.de>,
	Linux OMAP Mailing List <linux-omap@vger.kernel.org>
Subject: Re: [PATCH 3/3] watchdog: omap: simplify assignment of bootstatus
Date: Fri, 24 Apr 2015 09:45:32 -0500	[thread overview]
Message-ID: <20150424144532.GD5692@saruman.tx.rr.com> (raw)
In-Reply-To: <1429868913-24049-4-git-send-email-u.kleine-koenig@pengutronix.de>

[-- Attachment #1: Type: text/plain, Size: 1767 bytes --]

On Fri, Apr 24, 2015 at 11:48:33AM +0200, Uwe Kleine-König wrote:
> Instead of using an over-long expression involving the ?: operator use
> an if and intead of an else branch rely on the fact that the data
> structure was allocated using devm_kzalloc. This also allows to put the
> used helper variable into a more local scope.
> 
> There is no functional change.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

looks good to me

Reviewed-by: Felipe Balbi <balbi@ti.com>

> ---
>  drivers/watchdog/omap_wdt.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
> index 479e7c8e44f5..0421c06a6cf0 100644
> --- a/drivers/watchdog/omap_wdt.c
> +++ b/drivers/watchdog/omap_wdt.c
> @@ -209,7 +209,6 @@ static int omap_wdt_probe(struct platform_device *pdev)
>  	struct omap_wd_timer_platform_data *pdata = dev_get_platdata(&pdev->dev);
>  	struct resource *res;
>  	struct omap_wdt_dev *wdev;
> -	u32 rs;
>  	int ret;
>  
>  	wdev = devm_kzalloc(&pdev->dev, sizeof(*wdev), GFP_KERNEL);
> @@ -242,12 +241,11 @@ static int omap_wdt_probe(struct platform_device *pdev)
>  	pm_runtime_enable(wdev->dev);
>  	pm_runtime_get_sync(wdev->dev);
>  
> -	if (pdata && pdata->read_reset_sources)
> -		rs = pdata->read_reset_sources();
> -	else
> -		rs = 0;
> -	wdev->wdog.bootstatus = (rs & (1 << OMAP_MPU_WD_RST_SRC_ID_SHIFT)) ?
> -		WDIOF_CARDRESET : 0;
> +	if (pdata && pdata->read_reset_sources) {
> +		u32 rs = pdata->read_reset_sources();
> +		if (rs & (1 << OMAP_MPU_WD_RST_SRC_ID_SHIFT))
> +			wdev->wdog.bootstatus = WDIOF_CARDRESET;
> +	}
>  
>  	omap_wdt_disable(wdev);
>  
> -- 
> 2.1.4
> 

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2015-04-24 14:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-24  9:48 [PATCH 0/3] watchdog: omap: several cleanups Uwe Kleine-König
2015-04-24  9:48 ` [PATCH 1/3] watchdog: omap: use watchdog_init_timeout Uwe Kleine-König
2015-04-24 14:42   ` Felipe Balbi
2015-04-24 19:02     ` Uwe Kleine-König
2015-04-24 20:20       ` [PATCH 1a/3] watchdog: omap: clearify device tree documentation Uwe Kleine-König
2015-04-25  2:10         ` Felipe Balbi
2015-04-26 15:29           ` Guenter Roeck
2015-04-26 19:12             ` Uwe Kleine-König
2015-04-26 19:46               ` Guenter Roeck
2015-04-24  9:48 ` [PATCH 2/3] watchdog: omap: put struct watchdog_device into driver data Uwe Kleine-König
2015-04-24 14:44   ` Felipe Balbi
2015-04-24 19:10     ` Uwe Kleine-König
2015-04-24  9:48 ` [PATCH 3/3] watchdog: omap: simplify assignment of bootstatus Uwe Kleine-König
2015-04-24 14:45   ` Felipe Balbi [this message]
2015-04-24 19:03   ` Uwe Kleine-König
2015-04-26 15:28     ` Guenter Roeck
2015-04-26 19:14       ` Uwe Kleine-König

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=20150424144532.GD5692@saruman.tx.rr.com \
    --to=balbi@ti.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=lokeshvutla@ti.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=wim@iguana.be \
    /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