From patchwork Wed Jan 1 17:49:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 11315193 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 1F10217F0 for ; Wed, 1 Jan 2020 18:27:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 076FF207E0 for ; Wed, 1 Jan 2020 18:27:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727495AbgAAS06 (ORCPT ); Wed, 1 Jan 2020 13:26:58 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:13083 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727313AbgAAS02 (ORCPT ); Wed, 1 Jan 2020 13:26:28 -0500 X-IronPort-AV: E=Sophos;i="5.69,382,1571695200"; d="scan'208";a="334542271" Received: from palace.rsr.lip6.fr (HELO palace.lip6.fr) ([132.227.105.202]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/AES128-SHA256; 01 Jan 2020 19:26:23 +0100 From: Julia Lawall To: "H. Peter Anvin" Cc: kernel-janitors@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, netdev@vger.kernel.org, Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org Subject: [PATCH 00/10] use resource_size Date: Wed, 1 Jan 2020 18:49:40 +0100 Message-Id: <1577900990-8588-1-git-send-email-Julia.Lawall@inria.fr> X-Mailer: git-send-email 1.9.1 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org Use resource_size rather than a verbose computation on the end and start fields. The semantic patch that makes these changes is as follows: (http://coccinelle.lip6.fr/) @@ struct resource ptr; @@ - ((ptr.end) - (ptr.start) + 1) + resource_size(&ptr) @@ struct resource *ptr; @@ - ((ptr->end) - (ptr->start) + 1) + resource_size(ptr) @@ struct resource ptr; @@ - ((ptr.end) + 1 - (ptr.start)) + resource_size(&ptr) @@ struct resource *ptr; @@ - ((ptr->end) + 1 - (ptr->start)) + resource_size(ptr) --- arch/mips/kernel/setup.c | 6 ++---- arch/powerpc/platforms/83xx/km83xx.c | 2 +- arch/powerpc/platforms/powernv/pci-ioda.c | 4 ++-- arch/x86/kernel/crash.c | 2 +- drivers/net/ethernet/freescale/fman/mac.c | 4 ++-- drivers/usb/gadget/udc/omap_udc.c | 6 +++--- drivers/video/fbdev/cg14.c | 3 +-- drivers/video/fbdev/s1d13xxxfb.c | 16 ++++++++-------- sound/drivers/ml403-ac97cr.c | 4 +--- sound/soc/sof/imx/imx8.c | 3 +-- 10 files changed, 22 insertions(+), 28 deletions(-)