From: Takashi Iwai <tiwai@suse.de>
To: Julia Lawall <Julia.Lawall@inria.fr>
Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org,
kernel-janitors@vger.kernel.org, Takashi Iwai <tiwai@suse.com>
Subject: Re: [alsa-devel] [PATCH 02/10] ALSA: ml403-ac97cr: use resource_size
Date: Wed, 01 Jan 2020 20:17:28 +0100 [thread overview]
Message-ID: <s5hmub72dh3.wl-tiwai@suse.de> (raw)
In-Reply-To: <1577900990-8588-3-git-send-email-Julia.Lawall@inria.fr>
On Wed, 01 Jan 2020 18:49:42 +0100,
Julia Lawall wrote:
>
> Use resource_size rather than a verbose computation on
> the end and start fields.
>
> The semantic patch that makes this change 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>
Unfortunately this doesn't apply cleanly on my tree. I guess you
worked on linux-next which contains a change outside the sound git
tree that converts ioremap_nocache() to ioremap().
We may apply it in sound git tree and let conflicts resolved at the
merge time. OTOH, it's no urgent fix at all and can be postponed
after 5.6-rc1 merge, too -- then everything can be applied in a
cleaner way.
Let me know your preference.
thanks,
Takashi
>
> ---
> sound/drivers/ml403-ac97cr.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/sound/drivers/ml403-ac97cr.c b/sound/drivers/ml403-ac97cr.c
> index 4e6042e652f0..9de5caaf6047 100644
> --- a/sound/drivers/ml403-ac97cr.c
> +++ b/sound/drivers/ml403-ac97cr.c
> @@ -1100,9 +1100,7 @@ snd_ml403_ac97cr_create(struct snd_card *card, struct platform_device *pfdev,
> PDEBUG(INIT_INFO, "Trying to reserve resources now ...\n");
> resource = platform_get_resource(pfdev, IORESOURCE_MEM, 0);
> /* get "port" */
> - ml403_ac97cr->port = ioremap(resource->start,
> - (resource->end) -
> - (resource->start) + 1);
> + ml403_ac97cr->port = ioremap(resource->start, resource_size(resource));
> if (ml403_ac97cr->port == NULL) {
> snd_printk(KERN_ERR SND_ML403_AC97CR_DRIVER ": "
> "unable to remap memory region (%pR)\n",
>
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
next prev parent reply other threads:[~2020-01-01 19:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-01 17:49 [alsa-devel] [PATCH 00/10] use resource_size Julia Lawall
2020-01-01 17:49 ` [alsa-devel] [PATCH 02/10] ALSA: ml403-ac97cr: " Julia Lawall
2020-01-01 19:17 ` Takashi Iwai [this message]
2020-01-01 19:23 ` Julia Lawall
2020-01-02 15:13 ` Takashi Iwai
2020-01-01 17:49 ` [alsa-devel] [PATCH 06/10] ASoC: SOF: imx8: " Julia Lawall
2020-01-01 21:41 ` [alsa-devel] Applied "ASoC: SOF: imx8: use resource_size" to the asoc tree Mark Brown
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=s5hmub72dh3.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=Julia.Lawall@inria.fr \
--cc=alsa-devel@alsa-project.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tiwai@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox