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: 11685579 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 5AA1413A4 for ; Sun, 26 Jul 2020 09:07:53 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 76C0B206F6 for ; Sun, 26 Jul 2020 09:07:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="hxdNPuMz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 76C0B206F6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=inria.fr Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 5ADF01682; Sun, 26 Jul 2020 11:07:03 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5ADF01682 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1595754470; bh=vEYJCLr2P8VYExhV7SKytyRrCFqFtoMkvkF1ztPZ5k8=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=hxdNPuMzRuGqMZx9/OYMtk/pwCv6uEF2mx6PwiZGApKz6DlT7XN24dQC1MLzUzOHP 1kfEqP6z7p47zDWiBF5p+zpVmB9Qf5VgBxQY106MJoGV77A9ppuniEjEDBfKuKPRTR wqIXkzqzU4yZS/hZ2CFGPnDyK9d2wNIu3WSOAv5A= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C214EF800DE; Sun, 26 Jul 2020 11:07:02 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 32DFAF8020B; Sun, 26 Jul 2020 11:07:01 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 14835F800DE; Sun, 26 Jul 2020 11:06:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 14835F800DE 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 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 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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);