From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
To: Julia Lawall <Julia.Lawall@inria.fr>
Cc: Kristoffer Ericson <kristoffer.ericson@gmail.com>,
kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 03/10] fbdev: s1d13xxxfb: use resource_size
Date: Wed, 15 Jan 2020 17:06:30 +0100 [thread overview]
Message-ID: <847e5e23-38fd-ec1b-2296-456435c06fd6@samsung.com> (raw)
In-Reply-To: <1577900990-8588-4-git-send-email-Julia.Lawall@inria.fr>
On 1/1/20 6:49 PM, Julia Lawall wrote:
> Use resource_size rather than a verbose computation on
> the end and start fields.
>
> The semantic patch that makes these changes is as follows:
> (http://coccinelle.lip6.fr/)
>
> <smpl>
> @@ struct resource ptr; @@
> - (ptr.end - ptr.start + 1)
> + resource_size(&ptr)
> </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Patch queued for v5.6, thanks.
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/video/fbdev/s1d13xxxfb.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/video/fbdev/s1d13xxxfb.c b/drivers/video/fbdev/s1d13xxxfb.c
> index 8048499e398d..eaea8c373753 100644
> --- a/drivers/video/fbdev/s1d13xxxfb.c
> +++ b/drivers/video/fbdev/s1d13xxxfb.c
> @@ -746,9 +746,9 @@ s1d13xxxfb_remove(struct platform_device *pdev)
> }
>
> release_mem_region(pdev->resource[0].start,
> - pdev->resource[0].end - pdev->resource[0].start +1);
> + resource_size(&pdev->resource[0]));
> release_mem_region(pdev->resource[1].start,
> - pdev->resource[1].end - pdev->resource[1].start +1);
> + resource_size(&pdev->resource[1]));
> return 0;
> }
>
> @@ -788,14 +788,14 @@ static int s1d13xxxfb_probe(struct platform_device *pdev)
> }
>
> if (!request_mem_region(pdev->resource[0].start,
> - pdev->resource[0].end - pdev->resource[0].start +1, "s1d13xxxfb mem")) {
> + resource_size(&pdev->resource[0]), "s1d13xxxfb mem")) {
> dev_dbg(&pdev->dev, "request_mem_region failed\n");
> ret = -EBUSY;
> goto bail;
> }
>
> if (!request_mem_region(pdev->resource[1].start,
> - pdev->resource[1].end - pdev->resource[1].start +1, "s1d13xxxfb regs")) {
> + resource_size(&pdev->resource[1]), "s1d13xxxfb regs")) {
> dev_dbg(&pdev->dev, "request_mem_region failed\n");
> ret = -EBUSY;
> goto bail;
> @@ -810,7 +810,7 @@ static int s1d13xxxfb_probe(struct platform_device *pdev)
> platform_set_drvdata(pdev, info);
> default_par = info->par;
> default_par->regs = ioremap(pdev->resource[1].start,
> - pdev->resource[1].end - pdev->resource[1].start +1);
> + resource_size(&pdev->resource[1]));
> if (!default_par->regs) {
> printk(KERN_ERR PFX "unable to map registers\n");
> ret = -ENOMEM;
> @@ -819,7 +819,7 @@ static int s1d13xxxfb_probe(struct platform_device *pdev)
> info->pseudo_palette = default_par->pseudo_palette;
>
> info->screen_base = ioremap(pdev->resource[0].start,
> - pdev->resource[0].end - pdev->resource[0].start +1);
> + resource_size(&pdev->resource[0]));
>
> if (!info->screen_base) {
> printk(KERN_ERR PFX "unable to map framebuffer\n");
> @@ -857,9 +857,9 @@ static int s1d13xxxfb_probe(struct platform_device *pdev)
>
> info->fix = s1d13xxxfb_fix;
> info->fix.mmio_start = pdev->resource[1].start;
> - info->fix.mmio_len = pdev->resource[1].end - pdev->resource[1].start + 1;
> + info->fix.mmio_len = resource_size(&pdev->resource[1]);
> info->fix.smem_start = pdev->resource[0].start;
> - info->fix.smem_len = pdev->resource[0].end - pdev->resource[0].start + 1;
> + info->fix.smem_len = resource_size(&pdev->resource[0]);
>
> printk(KERN_INFO PFX "regs mapped at 0x%p, fb %d KiB mapped at 0x%p\n",
> default_par->regs, info->fix.smem_len / 1024, info->screen_base);
>
>
>
next prev parent reply other threads:[~2020-01-15 16:06 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-01 17:49 [PATCH 00/10] " Julia Lawall
2020-01-01 17:49 ` [PATCH 01/10] USB: omap_udc: " Julia Lawall
2020-01-01 17:49 ` [PATCH 02/10] ALSA: ml403-ac97cr: " Julia Lawall
2020-01-01 19:17 ` Takashi Iwai
2020-01-01 19:23 ` Julia Lawall
2020-01-02 15:13 ` Takashi Iwai
2020-01-01 17:49 ` [PATCH 03/10] fbdev: s1d13xxxfb: " Julia Lawall
2020-01-15 16:06 ` Bartlomiej Zolnierkiewicz [this message]
2020-01-01 17:49 ` [PATCH 04/10] fsl/fman: " Julia Lawall
2020-01-03 0:31 ` David Miller
2020-01-01 17:49 ` [PATCH 05/10] powerpc/83xx: " Julia Lawall
2020-01-06 18:06 ` Scott Wood
2020-01-29 5:17 ` Michael Ellerman
2020-01-01 17:49 ` [PATCH 06/10] ASoC: SOF: imx8: " Julia Lawall
2020-01-01 21:41 ` Applied "ASoC: SOF: imx8: use resource_size" to the asoc tree Mark Brown
2020-01-01 17:49 ` [PATCH 07/10] video: fbdev: use resource_size Julia Lawall
2020-01-15 16:10 ` Bartlomiej Zolnierkiewicz
2020-01-01 17:49 ` [PATCH 08/10] MIPS: " Julia Lawall
2020-01-01 22:25 ` Philippe Mathieu-Daudé
2020-01-10 19:36 ` Paul Burton
2020-01-01 17:49 ` [PATCH 09/10] x86/crash: " Julia Lawall
2020-01-09 13:47 ` [tip: x86/cleanups] x86/crash: Use resource_size() tip-bot2 for Julia Lawall
2020-01-01 17:49 ` [PATCH 10/10] powerpc/powernv: use resource_size Julia Lawall
2020-01-29 5:17 ` Michael Ellerman
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=847e5e23-38fd-ec1b-2296-456435c06fd6@samsung.com \
--to=b.zolnierkie@samsung.com \
--cc=Julia.Lawall@inria.fr \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=kristoffer.ericson@gmail.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®