From patchwork Thu Jul 20 05:49:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 9853889 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9BB05602BA for ; Thu, 20 Jul 2017 05:50:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86C752875A for ; Thu, 20 Jul 2017 05:50:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8536028756; Thu, 20 Jul 2017 05:50:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D9D1628789 for ; Thu, 20 Jul 2017 05:50:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date: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=yOFYv5rdJva2BEMKJk4+5x8p2dwtwSDvhMMqk5cyCXs=; b=WrhPA3rvtR23XI cPBb/RuoVTgNTzj+Oy6ZZQCAEg3hFbZflJttI3rxWX8j3a/9lBuYGnZjhRmMYcEWJQhVBdPazuieT YTTEibd2M5x4t6OWKfi7uWDOo+ZjFwCb1Sz+WVR4Lm4RQgYabvLUxxMTwyNKUeOCnOegAAOiBeyV/ a6DPJ+yUR4SsunH2+wT66L+Gr5IoP+RmT7FILIHKauo57h4QOmg/ldH2VMsvTHnm20iqCvpZoK9V8 fSU6HZal43wc6l44lD+iRTJ6lgOkAuvNPP7mjOMYkWQVAt0ZA/Go2fKGkMv4sVuXgxK5X67wMzg2L L7VuL8shXiPNgHqM2SdQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dY4Ll-0003ZT-2h; Thu, 20 Jul 2017 05:50:13 +0000 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dY4Lg-0002Mq-6h for linux-arm-kernel@lists.infradead.org; Thu, 20 Jul 2017 05:50:11 +0000 X-IronPort-AV: E=Sophos;i="5.40,382,1496095200"; d="scan'208";a="232141645" Received: from unknown (HELO [10.173.220.25]) ([212.7.174.156]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Jul 2017 07:49:36 +0200 Date: Thu, 20 Jul 2017 07:49:35 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: laurentiu.tudor@nxp.com Subject: [PATCH] staging: fsl-mc: fix resource_size.cocci warnings Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170719_225008_611820_38423AB2 X-CRM114-Status: UNSURE ( 9.16 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, stuyoder@gmail.com, arnd@arndb.de, marc.zyngier@arm.com, gregkh@linuxfoundation.org, roy.pledge@nxp.com, linux-kernel@vger.kernel.org, agraf@suse.de, catalin.horghidan@nxp.com, leoyang.li@nxp.com, bharat.bhushan@nxp.com, linux-arm-kernel@lists.infradead.org, Laurentiu Tudor Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use resource_size function on resource object instead of explicit computation. Generated by: scripts/coccinelle/api/resource_size.cocci Fixes: a037b7ec2eb7 ("staging: fsl-mc: allow the driver compile multi-arch") CC: Laurentiu Tudor Signed-off-by: Julia Lawall Signed-off-by: Fengguang Wu --- url: https://github.com/0day-ci/linux/commits/laurentiu-tudor-nxp-com/staging-fsl-mc-make-the-driver-compile-on-other-architectures/20170718-021715 :::::: branch date: 2 days ago :::::: commit date: 2 days ago mc-io.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/staging/fsl-mc/bus/mc-io.c +++ b/drivers/staging/fsl-mc/bus/mc-io.c @@ -242,8 +242,7 @@ int __must_check fsl_mc_portal_allocate( goto error_cleanup_resource; mc_portal_phys_addr = dpmcp_dev->regions[0].start; - mc_portal_size = dpmcp_dev->regions[0].end - - dpmcp_dev->regions[0].start + 1; + mc_portal_size = resource_size(dpmcp_dev->regions); if (WARN_ON(mc_portal_size != mc_bus_dev->mc_io->portal_size)) goto error_cleanup_resource;