All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>,
	LINUXWATCHDOG <linux-watchdog@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Joel Stanley <joel@jms.id.au>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Baruch Siach <baruch@tkos.co.il>,
	Keguang Zhang <keguang.zhang@gmail.com>,
	Vladimir Zapolskiy <vz@mleia.com>,
	Kevin Hilman <khilman@baylibre.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Avi Fishman <avifishman70@gmail.com>,
	Nancy Yuen <yuenn@google.com>,
	Brendan Higgins <brendanhiggins@google.com>,
	Wan ZongShun <mcuos.com@gmail.com>,
	Michal Simek <michal.simek@xilinx.com>,
	Sylvain Lemieux <slemieux.tyco@gmail.com>,
	Kukjin Kim <kgene@kernel.org>, Barry Song <baohua@kernel.org>,
	Orson Zhai <orsonzhai@gmail.com>,
	Patrice Chotard <patrice.chotard@st.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Maxime Ripard <maxime.ripard@bootlin.com>,
	Chen-Yu Tsai <wens@csie.org>,
	Marc Gonzalez <marc.w.gonzalez@free.fr>,
	Thierry Reding <thierry.reding@gmail.com>,
	Shawn Guo <shawnguo@kernel.org>
Subject: Re: [PATCH] watchdog: Convert to use devm_platform_ioremap_resource
Date: Wed, 3 Apr 2019 11:18:18 +0700	[thread overview]
Message-ID: <CACRpkdbGCoXGNOveo3GR9OwRgLC_DYEaCXUqthpcojEzbdbN0g@mail.gmail.com> (raw)
In-Reply-To: <1554231713-14137-1-git-send-email-linux@roeck-us.net>

On Wed, Apr 3, 2019 at 2:02 AM Guenter Roeck <linux@roeck-us.net> wrote:

> Use devm_platform_ioremap_resource to reduce source code size,
> improve readability, and reduce the likelyhood of bugs.
>
> The conversion was done automatically with coccinelle using the
> following semantic patch.
>
> @r@
> identifier res, pdev;
> expression a;
> expression index;
> expression e;
> @@
>
> <+...
> - res = platform_get_resource(pdev, IORESOURCE_MEM, index);
> - a = devm_ioremap_resource(e, res);
> + a = devm_platform_ioremap_resource(pdev, index);
> ...+>
>
> @depends on r@
> identifier r.res;
> @@
> - struct resource *res;
>   ... when != res
>
> @@
> identifier res, pdev;
> expression index;
> expression a;
> @@
> - struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, index);
> - a = devm_ioremap_resource(&pdev->dev, res);
> + a = devm_platform_ioremap_resource(pdev, index);
>
> Cc: Joel Stanley <joel@jms.id.au>
> Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Baruch Siach <baruch@tkos.co.il>
> Cc: Keguang Zhang <keguang.zhang@gmail.com>
> Cc: Vladimir Zapolskiy <vz@mleia.com>
> Cc: Kevin Hilman <khilman@baylibre.com>
> Cc: Matthias Brugger <matthias.bgg@gmail.com>
> Cc: Avi Fishman <avifishman70@gmail.com>
> Cc: Nancy Yuen <yuenn@google.com>
> Cc: Brendan Higgins <brendanhiggins@google.com>
> Cc: Wan ZongShun <mcuos.com@gmail.com>
> Cc: Michal Simek <michal.simek@xilinx.com>
> Cc: Sylvain Lemieux <slemieux.tyco@gmail.com>
> Cc: Kukjin Kim <kgene@kernel.org>
> Cc: Barry Song <baohua@kernel.org>
> Cc: Orson Zhai <orsonzhai@gmail.com>
> Cc: Patrice Chotard <patrice.chotard@st.com>
> Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> Cc: Chen-Yu Tsai <wens@csie.org>
> Cc: Marc Gonzalez <marc.w.gonzalez@free.fr>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>

Nice Cocinelle work!!
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

  parent reply	other threads:[~2019-04-03  4:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-02 19:01 [PATCH] watchdog: Convert to use devm_platform_ioremap_resource Guenter Roeck
2019-04-02 21:29 ` Alexandre Belloni
2019-04-03  0:22 ` Joel Stanley
2019-04-03  4:18 ` Linus Walleij [this message]
2019-04-03  6:08 ` Maxime Ripard
2019-04-03  7:09 ` Michal Simek
2019-04-03  8:47 ` Thierry Reding
2019-04-03 15:10 ` Florian Fainelli
2019-04-04  9:23 ` Patrice CHOTARD
2019-04-05 17:59 ` Vladimir Zapolskiy

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=CACRpkdbGCoXGNOveo3GR9OwRgLC_DYEaCXUqthpcojEzbdbN0g@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=avifishman70@gmail.com \
    --cc=baohua@kernel.org \
    --cc=baruch@tkos.co.il \
    --cc=brendanhiggins@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=joel@jms.id.au \
    --cc=keguang.zhang@gmail.com \
    --cc=kgene@kernel.org \
    --cc=khilman@baylibre.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=marc.w.gonzalez@free.fr \
    --cc=matthias.bgg@gmail.com \
    --cc=maxime.ripard@bootlin.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=mcuos.com@gmail.com \
    --cc=michal.simek@xilinx.com \
    --cc=nicolas.ferre@microchip.com \
    --cc=orsonzhai@gmail.com \
    --cc=patrice.chotard@st.com \
    --cc=shawnguo@kernel.org \
    --cc=slemieux.tyco@gmail.com \
    --cc=thierry.reding@gmail.com \
    --cc=vz@mleia.com \
    --cc=wens@csie.org \
    --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 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.