From patchwork Sun Jul 26 08:25:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 11685581 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2972C138C for ; Sun, 26 Jul 2020 09:09:17 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 02F69206F6 for ; Sun, 26 Jul 2020 09:09:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="i3d/xmEp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 02F69206F6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=inria.fr Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=x1yehH1Ocs6B31AC5uAlQTKeBp/5Kv3uX7VswB4rtZY=; b=i3d/xmEpx1WRHcNcGiJjqdSu7F VMYHkGXqndyEnXBU07N/yxLDv1L70YGUtzxTTNC8SWnWxNbjLi8ZtserVClotXeUz0vSytFOtlgc3 9HZQlVZHxQixHSKoJVjRVgoyiMdlfsAUPuMh+5yIbTUUYA1N83+6HhnpLBDIuVuNVTwijfdVgIwQx PSLVrWiYrUglAfVGUftMKiV1cKCTei3mBXLDRRNwpUfT9u6ozFviMunaCWLWwIofBQVaRMmj631mu KJSPVPKfCmvENZ2XO9VZz7Q+R+SH4VeFI2kGmZNLe+bXz4Nr3bdRl6oTbtAom85cB76aK13GX2h10 n8fWx5mA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jzccU-0006TP-NH; Sun, 26 Jul 2020 09:06:58 +0000 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jzccR-0006SJ-75 for linux-arm-kernel@lists.infradead.org; Sun, 26 Jul 2020 09:06:56 +0000 X-IronPort-AV: E=Sophos;i="5.75,398,1589234400"; d="scan'208";a="461332981" Received: from palace.rsr.lip6.fr (HELO palace.lip6.fr) ([132.227.105.202]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/AES256-SHA256; 26 Jul 2020 11:06:48 +0200 From: Julia Lawall To: Pierre-Louis Bossart Subject: [PATCH] ASoC: SOF: imx: use resource_size Date: Sun, 26 Jul 2020 10:25:33 +0200 Message-Id: <1595751933-4952-1-git-send-email-Julia.Lawall@inria.fr> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200726_050655_431159_AFA9CC05 X-CRM114-Status: UNSURE ( 9.97 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.0 (-----) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-5.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [192.134.164.83 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [192.134.164.83 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 , Jaroslav Kysela , Daniel Baluta , linux-arm-kernel@lists.infradead.org, sound-open-firmware@alsa-project.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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);