Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6033909imu; Wed, 30 Jan 2019 07:41:54 -0800 (PST) X-Google-Smtp-Source: ALg8bN79a35/NKdYCooI68AdfpahysKpOqHMKp8zC/4UqxRYW9Xnc6eCbW+9QVqpkCMBozPGB6Uw X-Received: by 2002:a63:4706:: with SMTP id u6mr26500873pga.95.1548862914731; Wed, 30 Jan 2019 07:41:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548862914; cv=none; d=google.com; s=arc-20160816; b=Xq23Izjmz/OpjPDjE1owE6f45Zg96rotXXnfwP4FZYpVH7S7JPtXH7AqDqHgtoJsUi 70JpSvWBM3rbHKS/sDqeMjNcub+/GDm7CA12bKq5dLBLp/4T5avSXpOVxxvnaznQVXX6 J37wHZ0xkFQ48Dl7IX2S5lFEvWJAyrgFkswTLYnDmwgzMjqQHJgxKZv4z3GR55rxW0tM Chlx3Z6CXzSV+xdRFiLzxuGREeCHB9mHr/qpFcm1877MH/v4klv/LKXfNbSBiMWoW8ta stVtnDxFdTnvTf7dGgIMzjzAPhB25UhLuAvMCdDomrM31iJpcQoL24Ce/SKIyPota0PP b1Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=D0upQ+HWQb//3pOYj7ogPT1nqkp1Zqwl6MZ5HCMNjzg=; b=Gfff+2nWmqQt0AQ6jjsUTl/oouoGafkBdytyCuPJsZ3ERT72enZ2H8pvVQ9daSI1s9 2jbj0ceyBaVdt8gypTU0l75mtRYYdJPXgPzCC1DkqiKlwMoFgxPafl+AJn1EhQ5EKS81 DtUceXqwSa8ibwFAYgS2M1UWm5aWlBP8PF18QHfyVQ53n9TKbVUfymj2q4C9BGO7yDQt bNiqs7LBqfcAoXQzFtVgBGvHZD0oSJF7wsmNTymXZUN2n9TB5zyaxpGfHJ7WrW9/Nrnv YjAsJGxrXo2QMbBOkV8k6UCjC7zlOdaE/p7Wy1bxDGDMOFEveEqT1kNgqMiQ5iCRLJcY 0CDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="hNGiPyC/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 191si1715128pgf.41.2019.01.30.07.41.38; Wed, 30 Jan 2019 07:41:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="hNGiPyC/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729755AbfA3PlO (ORCPT + 99 others); Wed, 30 Jan 2019 10:41:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:40048 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725808AbfA3PlN (ORCPT ); Wed, 30 Jan 2019 10:41:13 -0500 Received: from localhost (unknown [69.71.4.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B43272084C; Wed, 30 Jan 2019 15:41:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548862873; bh=nHm7eOy82+tzDzSBzaBfZdPdLctcjTIhgr5gGa+okSI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hNGiPyC/2mtbImVGxmhjNjcrdUSOYao/wiyRwzYE92nc4QIXcwxTXuIgp5UOe3TzX xCysz01Eo8IoRLJvpaSdCc0miZmt/jBkZ/+YBhcu7UUGeW7s8m8djQHi1l+hCeQJ2R P9vmAY2hl5VLlycA78fFklejIP31Xhzg80/WcLAs= Date: Wed, 30 Jan 2019 09:41:11 -0600 From: Bjorn Helgaas To: honghui.zhang@mediatek.com Cc: lorenzo.pieralisi@arm.com, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, ryder.lee@mediatek.com, youlin.pei@mediatek.com, jianjun.wang@mediatek.com Subject: Re: [PATCH] PCI: Mediatek: Use resource_size function on resource object Message-ID: <20190130154111.GC229773@google.com> References: <1546409033-20412-1-git-send-email-honghui.zhang@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1546409033-20412-1-git-send-email-honghui.zhang@mediatek.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Please pay attention to the changelog conventions, e.g., next time use "PCI: mediatek: ..." so yours matches "git log --oneline drivers/pci/controller/pcie-mediatek.c" On Wed, Jan 02, 2019 at 02:03:53PM +0800, honghui.zhang@mediatek.com wrote: > From: Honghui Zhang > > drivers/pci/pcie-mediatek.c:720:13-16: WARNING: Suspicious code. resource_size is maybe missing with mem > > Generated by: scripts/coccinelle/api/resource_size.cocci This is not a changelog; it's only a restatement of the warning. Next time please include a description of the change. It's OK if it repeats the subject. > Signed-off-by: Honghui Zhang > --- > drivers/pci/controller/pcie-mediatek.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c > index e307166..0168376 100644 > --- a/drivers/pci/controller/pcie-mediatek.c > +++ b/drivers/pci/controller/pcie-mediatek.c > @@ -654,7 +654,6 @@ static int mtk_pcie_startup_port_v2(struct mtk_pcie_port *port) > struct resource *mem = &pcie->mem; > const struct mtk_pcie_soc *soc = port->pcie->soc; > u32 val; > - size_t size; > int err; > > /* MT7622 platforms need to enable LTSSM and ASPM from PCIe subsys */ > @@ -706,8 +705,7 @@ static int mtk_pcie_startup_port_v2(struct mtk_pcie_port *port) > mtk_pcie_enable_msi(port); > > /* Set AHB to PCIe translation windows */ > - size = mem->end - mem->start; > - val = lower_32_bits(mem->start) | AHB2PCIE_SIZE(fls(size)); > + val = lower_32_bits(mem->start) | AHB2PCIE_SIZE(fls(resource_size(mem))); > writel(val, port->base + PCIE_AHB_TRANS_BASE0_L); > > val = upper_32_bits(mem->start); > -- > 2.6.4 >