Skip to content

Commit afd842c

Browse files
JuliaLawallbroonie
authored andcommitted
ASoC: SOF: imx: use resource_size
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 39473c2 commit afd842c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

sound/soc/sof/imx/imx8m.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,7 @@ static int imx8m_probe(struct snd_sof_dev *sdev)
188188
}
189189

190190
sdev->bar[SOF_FW_BLK_TYPE_SRAM] = devm_ioremap_wc(sdev->dev, res.start,
191-
res.end - res.start +
192-
1);
191+
resource_size(&res));
193192
if (!sdev->bar[SOF_FW_BLK_TYPE_SRAM]) {
194193
dev_err(sdev->dev, "failed to ioremap mem 0x%x size 0x%x\n",
195194
base, size);

0 commit comments

Comments
 (0)