From: Florian Fainelli <florian@openwrt.org>
To: Joe Perches <joe@perches.com>
Cc: Jiri Kosina <trivial@kernel.org>,
Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>,
Linus Walleij <linus.walleij@stericsson.com>,
David Brown <davidb@codeaurora.org>,
Daniel Walker <dwalker@fifo99.com>,
Bryan Huntsman <bryanh@codeaurora.org>,
Wim Van Sebroeck <wim@iguana.be>,
Russell King <linux@arm.linux.org.uk>,
Ralf Baechle <ralf@linux-mips.org>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-mips@linux-mips.org,
linux-arm-msm@vger.kernel.org, linux-fbdev@vger.kernel.org,
linux-watchdog@vger.kernel.org
Subject: Re: [trivial PATCH 1/2] treewide: Fix iomap resource size miscalculations
Date: Wed, 23 Mar 2011 21:29:52 +0100 [thread overview]
Message-ID: <201103232129.53053.florian@openwrt.org> (raw)
In-Reply-To: <c4422b4a8ee132d3adac95fd86237c61b2f8b364.1300909446.git.joe@perches.com>
On Wednesday 23 March 2011 20:55:36 Joe Perches wrote:
> Convert off-by-1 r->end - r->start to resource_size(r)
>
> Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Florian Fainelli <florian@openwrt.org>
(for rb532 and bcm63xx_wdt)
> ---
> arch/arm/mach-ux500/mbox-db5500.c | 6 ++----
> arch/mips/rb532/gpio.c | 2 +-
> drivers/video/msm/mddi.c | 2 +-
> drivers/watchdog/bcm63xx_wdt.c | 2 +-
> 4 files changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/arch/arm/mach-ux500/mbox-db5500.c
> b/arch/arm/mach-ux500/mbox-db5500.c index a4ffb9f..2b2d51c 100644
> --- a/arch/arm/mach-ux500/mbox-db5500.c
> +++ b/arch/arm/mach-ux500/mbox-db5500.c
> @@ -416,8 +416,7 @@ struct mbox *mbox_setup(u8 mbox_id, mbox_recv_cb_t
> *mbox_cb, void *priv) dev_dbg(&(mbox->pdev->dev),
> "Resource name: %s start: 0x%X, end: 0x%X\n",
> resource->name, resource->start, resource->end);
> - mbox->virtbase_peer =
> - ioremap(resource->start, resource->end - resource->start);
> + mbox->virtbase_peer = ioremap(resource->start, resource_size(resource));
> if (!mbox->virtbase_peer) {
> dev_err(&(mbox->pdev->dev), "Unable to ioremap peer mbox\n");
> mbox = NULL;
> @@ -440,8 +439,7 @@ struct mbox *mbox_setup(u8 mbox_id, mbox_recv_cb_t
> *mbox_cb, void *priv) dev_dbg(&(mbox->pdev->dev),
> "Resource name: %s start: 0x%X, end: 0x%X\n",
> resource->name, resource->start, resource->end);
> - mbox->virtbase_local =
> - ioremap(resource->start, resource->end - resource->start);
> + mbox->virtbase_local = ioremap(resource->start, resource_size(resource));
> if (!mbox->virtbase_local) {
> dev_err(&(mbox->pdev->dev), "Unable to ioremap local mbox\n");
> mbox = NULL;
> diff --git a/arch/mips/rb532/gpio.c b/arch/mips/rb532/gpio.c
> index 37de05d..6c47dfe 100644
> --- a/arch/mips/rb532/gpio.c
> +++ b/arch/mips/rb532/gpio.c
> @@ -185,7 +185,7 @@ int __init rb532_gpio_init(void)
> struct resource *r;
>
> r = rb532_gpio_reg0_res;
> - rb532_gpio_chip->regbase = ioremap_nocache(r->start, r->end - r->start);
> + rb532_gpio_chip->regbase = ioremap_nocache(r->start, resource_size(r));
>
> if (!rb532_gpio_chip->regbase) {
> printk(KERN_ERR "rb532: cannot remap GPIO register 0\n");
> diff --git a/drivers/video/msm/mddi.c b/drivers/video/msm/mddi.c
> index b66d86a..178b072 100644
> --- a/drivers/video/msm/mddi.c
> +++ b/drivers/video/msm/mddi.c
> @@ -679,7 +679,7 @@ static int __devinit mddi_probe(struct platform_device
> *pdev) printk(KERN_ERR "mddi: no associated mem resource!\n");
> return -ENOMEM;
> }
> - mddi->base = ioremap(resource->start, resource->end - resource->start);
> + mddi->base = ioremap(resource->start, resource_size(resource));
> if (!mddi->base) {
> printk(KERN_ERR "mddi: failed to remap base!\n");
> ret = -EINVAL;
> diff --git a/drivers/watchdog/bcm63xx_wdt.c
> b/drivers/watchdog/bcm63xx_wdt.c index 3c5045a..5064e83 100644
> --- a/drivers/watchdog/bcm63xx_wdt.c
> +++ b/drivers/watchdog/bcm63xx_wdt.c
> @@ -248,7 +248,7 @@ static int __devinit bcm63xx_wdt_probe(struct
> platform_device *pdev) return -ENODEV;
> }
>
> - bcm63xx_wdt_device.regs = ioremap_nocache(r->start, r->end - r->start);
> + bcm63xx_wdt_device.regs = ioremap_nocache(r->start, resource_size(r));
> if (!bcm63xx_wdt_device.regs) {
> dev_err(&pdev->dev, "failed to remap I/O resources\n");
> return -ENXIO;
WARNING: multiple messages have this Message-ID (diff)
From: Florian Fainelli <florian@openwrt.org>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [trivial PATCH 1/2] treewide: Fix iomap resource size miscalculations
Date: Wed, 23 Mar 2011 20:29:52 +0000 [thread overview]
Message-ID: <201103232129.53053.florian@openwrt.org> (raw)
In-Reply-To: <c4422b4a8ee132d3adac95fd86237c61b2f8b364.1300909446.git.joe@perches.com>
On Wednesday 23 March 2011 20:55:36 Joe Perches wrote:
> Convert off-by-1 r->end - r->start to resource_size(r)
>
> Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Florian Fainelli <florian@openwrt.org>
(for rb532 and bcm63xx_wdt)
> ---
> arch/arm/mach-ux500/mbox-db5500.c | 6 ++----
> arch/mips/rb532/gpio.c | 2 +-
> drivers/video/msm/mddi.c | 2 +-
> drivers/watchdog/bcm63xx_wdt.c | 2 +-
> 4 files changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/arch/arm/mach-ux500/mbox-db5500.c
> b/arch/arm/mach-ux500/mbox-db5500.c index a4ffb9f..2b2d51c 100644
> --- a/arch/arm/mach-ux500/mbox-db5500.c
> +++ b/arch/arm/mach-ux500/mbox-db5500.c
> @@ -416,8 +416,7 @@ struct mbox *mbox_setup(u8 mbox_id, mbox_recv_cb_t
> *mbox_cb, void *priv) dev_dbg(&(mbox->pdev->dev),
> "Resource name: %s start: 0x%X, end: 0x%X\n",
> resource->name, resource->start, resource->end);
> - mbox->virtbase_peer > - ioremap(resource->start, resource->end - resource->start);
> + mbox->virtbase_peer = ioremap(resource->start, resource_size(resource));
> if (!mbox->virtbase_peer) {
> dev_err(&(mbox->pdev->dev), "Unable to ioremap peer mbox\n");
> mbox = NULL;
> @@ -440,8 +439,7 @@ struct mbox *mbox_setup(u8 mbox_id, mbox_recv_cb_t
> *mbox_cb, void *priv) dev_dbg(&(mbox->pdev->dev),
> "Resource name: %s start: 0x%X, end: 0x%X\n",
> resource->name, resource->start, resource->end);
> - mbox->virtbase_local > - ioremap(resource->start, resource->end - resource->start);
> + mbox->virtbase_local = ioremap(resource->start, resource_size(resource));
> if (!mbox->virtbase_local) {
> dev_err(&(mbox->pdev->dev), "Unable to ioremap local mbox\n");
> mbox = NULL;
> diff --git a/arch/mips/rb532/gpio.c b/arch/mips/rb532/gpio.c
> index 37de05d..6c47dfe 100644
> --- a/arch/mips/rb532/gpio.c
> +++ b/arch/mips/rb532/gpio.c
> @@ -185,7 +185,7 @@ int __init rb532_gpio_init(void)
> struct resource *r;
>
> r = rb532_gpio_reg0_res;
> - rb532_gpio_chip->regbase = ioremap_nocache(r->start, r->end - r->start);
> + rb532_gpio_chip->regbase = ioremap_nocache(r->start, resource_size(r));
>
> if (!rb532_gpio_chip->regbase) {
> printk(KERN_ERR "rb532: cannot remap GPIO register 0\n");
> diff --git a/drivers/video/msm/mddi.c b/drivers/video/msm/mddi.c
> index b66d86a..178b072 100644
> --- a/drivers/video/msm/mddi.c
> +++ b/drivers/video/msm/mddi.c
> @@ -679,7 +679,7 @@ static int __devinit mddi_probe(struct platform_device
> *pdev) printk(KERN_ERR "mddi: no associated mem resource!\n");
> return -ENOMEM;
> }
> - mddi->base = ioremap(resource->start, resource->end - resource->start);
> + mddi->base = ioremap(resource->start, resource_size(resource));
> if (!mddi->base) {
> printk(KERN_ERR "mddi: failed to remap base!\n");
> ret = -EINVAL;
> diff --git a/drivers/watchdog/bcm63xx_wdt.c
> b/drivers/watchdog/bcm63xx_wdt.c index 3c5045a..5064e83 100644
> --- a/drivers/watchdog/bcm63xx_wdt.c
> +++ b/drivers/watchdog/bcm63xx_wdt.c
> @@ -248,7 +248,7 @@ static int __devinit bcm63xx_wdt_probe(struct
> platform_device *pdev) return -ENODEV;
> }
>
> - bcm63xx_wdt_device.regs = ioremap_nocache(r->start, r->end - r->start);
> + bcm63xx_wdt_device.regs = ioremap_nocache(r->start, resource_size(r));
> if (!bcm63xx_wdt_device.regs) {
> dev_err(&pdev->dev, "failed to remap I/O resources\n");
> return -ENXIO;
WARNING: multiple messages have this Message-ID (diff)
From: florian@openwrt.org (Florian Fainelli)
To: linux-arm-kernel@lists.infradead.org
Subject: [trivial PATCH 1/2] treewide: Fix iomap resource size miscalculations
Date: Wed, 23 Mar 2011 21:29:52 +0100 [thread overview]
Message-ID: <201103232129.53053.florian@openwrt.org> (raw)
In-Reply-To: <c4422b4a8ee132d3adac95fd86237c61b2f8b364.1300909446.git.joe@perches.com>
On Wednesday 23 March 2011 20:55:36 Joe Perches wrote:
> Convert off-by-1 r->end - r->start to resource_size(r)
>
> Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Florian Fainelli <florian@openwrt.org>
(for rb532 and bcm63xx_wdt)
> ---
> arch/arm/mach-ux500/mbox-db5500.c | 6 ++----
> arch/mips/rb532/gpio.c | 2 +-
> drivers/video/msm/mddi.c | 2 +-
> drivers/watchdog/bcm63xx_wdt.c | 2 +-
> 4 files changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/arch/arm/mach-ux500/mbox-db5500.c
> b/arch/arm/mach-ux500/mbox-db5500.c index a4ffb9f..2b2d51c 100644
> --- a/arch/arm/mach-ux500/mbox-db5500.c
> +++ b/arch/arm/mach-ux500/mbox-db5500.c
> @@ -416,8 +416,7 @@ struct mbox *mbox_setup(u8 mbox_id, mbox_recv_cb_t
> *mbox_cb, void *priv) dev_dbg(&(mbox->pdev->dev),
> "Resource name: %s start: 0x%X, end: 0x%X\n",
> resource->name, resource->start, resource->end);
> - mbox->virtbase_peer =
> - ioremap(resource->start, resource->end - resource->start);
> + mbox->virtbase_peer = ioremap(resource->start, resource_size(resource));
> if (!mbox->virtbase_peer) {
> dev_err(&(mbox->pdev->dev), "Unable to ioremap peer mbox\n");
> mbox = NULL;
> @@ -440,8 +439,7 @@ struct mbox *mbox_setup(u8 mbox_id, mbox_recv_cb_t
> *mbox_cb, void *priv) dev_dbg(&(mbox->pdev->dev),
> "Resource name: %s start: 0x%X, end: 0x%X\n",
> resource->name, resource->start, resource->end);
> - mbox->virtbase_local =
> - ioremap(resource->start, resource->end - resource->start);
> + mbox->virtbase_local = ioremap(resource->start, resource_size(resource));
> if (!mbox->virtbase_local) {
> dev_err(&(mbox->pdev->dev), "Unable to ioremap local mbox\n");
> mbox = NULL;
> diff --git a/arch/mips/rb532/gpio.c b/arch/mips/rb532/gpio.c
> index 37de05d..6c47dfe 100644
> --- a/arch/mips/rb532/gpio.c
> +++ b/arch/mips/rb532/gpio.c
> @@ -185,7 +185,7 @@ int __init rb532_gpio_init(void)
> struct resource *r;
>
> r = rb532_gpio_reg0_res;
> - rb532_gpio_chip->regbase = ioremap_nocache(r->start, r->end - r->start);
> + rb532_gpio_chip->regbase = ioremap_nocache(r->start, resource_size(r));
>
> if (!rb532_gpio_chip->regbase) {
> printk(KERN_ERR "rb532: cannot remap GPIO register 0\n");
> diff --git a/drivers/video/msm/mddi.c b/drivers/video/msm/mddi.c
> index b66d86a..178b072 100644
> --- a/drivers/video/msm/mddi.c
> +++ b/drivers/video/msm/mddi.c
> @@ -679,7 +679,7 @@ static int __devinit mddi_probe(struct platform_device
> *pdev) printk(KERN_ERR "mddi: no associated mem resource!\n");
> return -ENOMEM;
> }
> - mddi->base = ioremap(resource->start, resource->end - resource->start);
> + mddi->base = ioremap(resource->start, resource_size(resource));
> if (!mddi->base) {
> printk(KERN_ERR "mddi: failed to remap base!\n");
> ret = -EINVAL;
> diff --git a/drivers/watchdog/bcm63xx_wdt.c
> b/drivers/watchdog/bcm63xx_wdt.c index 3c5045a..5064e83 100644
> --- a/drivers/watchdog/bcm63xx_wdt.c
> +++ b/drivers/watchdog/bcm63xx_wdt.c
> @@ -248,7 +248,7 @@ static int __devinit bcm63xx_wdt_probe(struct
> platform_device *pdev) return -ENODEV;
> }
>
> - bcm63xx_wdt_device.regs = ioremap_nocache(r->start, r->end - r->start);
> + bcm63xx_wdt_device.regs = ioremap_nocache(r->start, resource_size(r));
> if (!bcm63xx_wdt_device.regs) {
> dev_err(&pdev->dev, "failed to remap I/O resources\n");
> return -ENXIO;
next prev parent reply other threads:[~2011-03-23 20:30 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-23 19:55 [PATCH 0/2] Fix resource size miscalculations Joe Perches
2011-03-23 19:55 ` Joe Perches
2011-03-23 19:55 ` Joe Perches
2011-03-23 19:55 ` [trivial PATCH 1/2] treewide: Fix iomap " Joe Perches
2011-03-23 19:55 ` Joe Perches
2011-03-23 19:55 ` Joe Perches
2011-03-23 19:55 ` Joe Perches
2011-03-23 20:11 ` Linus Walleij
2011-03-23 20:11 ` Linus Walleij
2011-03-23 20:11 ` Linus Walleij
2011-03-23 20:29 ` Florian Fainelli [this message]
2011-03-23 20:29 ` Florian Fainelli
2011-03-23 20:29 ` Florian Fainelli
2011-03-23 22:42 ` David Brown
2011-03-23 22:42 ` David Brown
2011-03-23 22:42 ` David Brown
2011-03-24 8:29 ` Wim Van Sebroeck
2011-03-24 8:29 ` Wim Van Sebroeck
2011-03-24 8:29 ` [trivial PATCH 1/2] treewide: Fix iomap resource size Wim Van Sebroeck
2011-03-24 22:27 ` [trivial PATCH 1/2] treewide: Fix iomap resource size miscalculations Ralf Baechle
2011-03-24 22:27 ` Ralf Baechle
2011-03-24 22:27 ` [trivial PATCH 1/2] treewide: Fix iomap resource size Ralf Baechle
2011-04-10 15:09 ` [trivial PATCH 1/2] treewide: Fix iomap resource size miscalculations Jiri Kosina
2011-04-10 15:09 ` Jiri Kosina
2011-04-10 15:09 ` [trivial PATCH 1/2] treewide: Fix iomap resource size Jiri Kosina
2011-03-23 19:55 ` [trivial PATCH 2/2] arm: mach-u300/gpio: Fix mem_region resource size miscalculations Joe Perches
2011-03-23 19:55 ` Joe Perches
2011-03-23 20:07 ` Linus Walleij
2011-03-23 20:07 ` Linus Walleij
2011-04-10 15:07 ` Jiri Kosina
2011-04-10 15:07 ` Jiri Kosina
2011-03-24 22:49 ` [PATCH 0/2] Fix " Joe Perches
2011-03-24 22:49 ` Joe Perches
2011-03-24 22:49 ` Joe Perches
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=201103232129.53053.florian@openwrt.org \
--to=florian@openwrt.org \
--cc=bryanh@codeaurora.org \
--cc=davidb@codeaurora.org \
--cc=dwalker@fifo99.com \
--cc=joe@perches.com \
--cc=linus.walleij@stericsson.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=ralf@linux-mips.org \
--cc=srinidhi.kasagar@stericsson.com \
--cc=trivial@kernel.org \
--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 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.