From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julia Lawall Date: Sun, 26 Jul 2020 08:25:33 +0000 Subject: [PATCH] ASoC: SOF: imx: use resource_size Message-Id: <1595751933-4952-1-git-send-email-Julia.Lawall@inria.fr> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Pierre-Louis Bossart Cc: alsa-devel@alsa-project.org, Fabio Estevam , linux-kernel@vger.kernel.org, Kai Vehmanen , Shawn Guo , Sascha Hauer , Takashi Iwai , kernel-janitors@vger.kernel.org, Liam Girdwood , Ranjani Sridharan , Mark Brown , NXP Linux Team , Pengutronix Kernel Team , Daniel Baluta , linux-arm-kernel@lists.infradead.org, sound-open-firmware@alsa-project.org 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/) @@ struct resource ptr; @@ - (ptr.end - ptr.start + 1) + resource_size(&ptr) Signed-off-by: Julia Lawall --- 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);