linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
To: "Uwe Kleine-König"
	<u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Wim Van Sebroeck <wim-IQzOog9fTRqzQB+pC5nmwQ@public.gmane.org>,
	Lokesh Vutla <lokeshvutla-l0cyMroinI0@public.gmane.org>,
	Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
	Linux OMAP Mailing List
	<linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.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-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1814 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-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

looks good to me

Reviewed-by: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>

> ---
>  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 --]

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

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1429868913-24049-1-git-send-email-u.kleine-koenig@pengutronix.de>
     [not found] ` <1429868913-24049-2-git-send-email-u.kleine-koenig@pengutronix.de>
     [not found]   ` <1429868913-24049-2-git-send-email-u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-04-24 14:42     ` [PATCH 1/3] watchdog: omap: use watchdog_init_timeout Felipe Balbi
2015-04-24 19:02       ` Uwe Kleine-König
     [not found]         ` <20150424190207.GU19431-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-04-24 20:20           ` [PATCH 1a/3] watchdog: omap: clearify device tree documentation Uwe Kleine-König
     [not found]             ` <1429906850-5420-1-git-send-email-u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-04-25  2:10               ` Felipe Balbi
     [not found]                 ` <20150425021024.GA14963-HgARHv6XitJaoMGHk7MhZQC/G2K4zDHf@public.gmane.org>
2015-04-26 15:29                   ` Guenter Roeck
     [not found]                     ` <553D0450.6050403-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2015-04-26 19:12                       ` Uwe Kleine-König
2015-04-26 19:46                         ` Guenter Roeck
     [not found] ` <1429868913-24049-3-git-send-email-u.kleine-koenig@pengutronix.de>
     [not found]   ` <1429868913-24049-3-git-send-email-u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-04-24 14:44     ` [PATCH 2/3] watchdog: omap: put struct watchdog_device into driver data Felipe Balbi
2015-04-24 19:10       ` Uwe Kleine-König
     [not found] ` <1429868913-24049-4-git-send-email-u.kleine-koenig@pengutronix.de>
     [not found]   ` <1429868913-24049-4-git-send-email-u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-04-24 14:45     ` Felipe Balbi [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=20150424144532.GD5692@saruman.tx.rr.com \
    --to=balbi-l0cymroini0@public.gmane.org \
    --cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lokeshvutla-l0cyMroinI0@public.gmane.org \
    --cc=u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=wim-IQzOog9fTRqzQB+pC5nmwQ@public.gmane.org \
    /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).