alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: SOF: imx: use resource_size
@ 2020-07-26  8:25 Julia Lawall
  2020-07-30 22:27 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2020-07-26  8:25 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: alsa-devel, Fabio Estevam, linux-kernel, Kai Vehmanen, Shawn Guo,
	Sascha Hauer, Takashi Iwai, kernel-janitors, Liam Girdwood,
	Ranjani Sridharan, Mark Brown, NXP Linux Team,
	Pengutronix Kernel Team, Daniel Baluta, linux-arm-kernel,
	sound-open-firmware

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>

---
 sound/soc/sof/imx/imx8m.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff -u -p a/sound/soc/sof/imx/imx8m.c b/sound/soc/sof/imx/imx8m.c
--- a/sound/soc/sof/imx/imx8m.c
+++ b/sound/soc/sof/imx/imx8m.c
@@ -188,8 +188,7 @@ static int imx8m_probe(struct snd_sof_de
 	}
 
 	sdev->bar[SOF_FW_BLK_TYPE_SRAM] = devm_ioremap_wc(sdev->dev, res.start,
-							  res.end - res.start +
-							  1);
+							  resource_size(&res));
 	if (!sdev->bar[SOF_FW_BLK_TYPE_SRAM]) {
 		dev_err(sdev->dev, "failed to ioremap mem 0x%x size 0x%x\n",
 			base, size);


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-30 22:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-26  8:25 [PATCH] ASoC: SOF: imx: use resource_size Julia Lawall
2020-07-30 22:27 ` Mark Brown

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).