From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D396C433F5 for ; Mon, 2 May 2022 09:37:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 105826B0072; Mon, 2 May 2022 05:37:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0B61C6B0073; Mon, 2 May 2022 05:37:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EE7F66B0074; Mon, 2 May 2022 05:37:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id E28096B0072 for ; Mon, 2 May 2022 05:37:41 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id B8B7A2B8AA for ; Mon, 2 May 2022 09:37:41 +0000 (UTC) X-FDA: 79420300722.27.5AC0AFB Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf13.hostedemail.com (Postfix) with ESMTP id 797AC20070 for ; Mon, 2 May 2022 09:37:30 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 274661FB; Mon, 2 May 2022 02:37:40 -0700 (PDT) Received: from [10.163.32.39] (unknown [10.163.32.39]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E9D673F774; Mon, 2 May 2022 02:37:33 -0700 (PDT) Message-ID: <204421f9-a0d9-35bb-ea86-ea4cea3b4f83@arm.com> Date: Mon, 2 May 2022 15:08:30 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v2 1/5] mm: ioremap: Use more sensibly name in ioremap_prot() Content-Language: en-US To: Kefeng Wang , catalin.marinas@arm.com, will@kernel.org, akpm@linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, hch@infradead.org, arnd@arndb.de References: <20220429103225.75121-1-wangkefeng.wang@huawei.com> <20220429103225.75121-2-wangkefeng.wang@huawei.com> From: Anshuman Khandual In-Reply-To: <20220429103225.75121-2-wangkefeng.wang@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 797AC20070 X-Stat-Signature: cm5yf9ccqqbgowxjyxgknjfapjwzec9d X-Rspam-User: Authentication-Results: imf13.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf13.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com X-Rspamd-Server: rspam09 X-HE-Tag: 1651484250-670161 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 4/29/22 16:02, Kefeng Wang wrote: > Use more meaningful and sensibly naming phys_addr > instead addr in ioremap_prot(). > > Suggested-by: Andrew Morton > Signed-off-by: Kefeng Wang Reviewed-by: Anshuman Khandual > --- > include/asm-generic/io.h | 2 +- > mm/ioremap.c | 12 ++++++------ > 2 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h > index 7ce93aaf69f8..e6ffa2519f08 100644 > --- a/include/asm-generic/io.h > +++ b/include/asm-generic/io.h > @@ -964,7 +964,7 @@ static inline void iounmap(volatile void __iomem *addr) > #elif defined(CONFIG_GENERIC_IOREMAP) > #include > > -void __iomem *ioremap_prot(phys_addr_t addr, size_t size, unsigned long prot); > +void __iomem *ioremap_prot(phys_addr_t phys_addr, size_t size, unsigned long prot); > void iounmap(volatile void __iomem *addr); > > static inline void __iomem *ioremap(phys_addr_t addr, size_t size) > diff --git a/mm/ioremap.c b/mm/ioremap.c > index 5fe598ecd9b7..1f9597fbcc07 100644 > --- a/mm/ioremap.c > +++ b/mm/ioremap.c > @@ -11,20 +11,20 @@ > #include > #include > > -void __iomem *ioremap_prot(phys_addr_t addr, size_t size, unsigned long prot) > +void __iomem *ioremap_prot(phys_addr_t phys_addr, size_t size, unsigned long prot) > { > unsigned long offset, vaddr; > phys_addr_t last_addr; > struct vm_struct *area; > > /* Disallow wrap-around or zero size */ > - last_addr = addr + size - 1; > - if (!size || last_addr < addr) > + last_addr = phys_addr + size - 1; > + if (!size || last_addr < phys_addr) > return NULL; > > /* Page-align mappings */ > - offset = addr & (~PAGE_MASK); > - addr -= offset; > + offset = phys_addr & (~PAGE_MASK); > + phys_addr -= offset; > size = PAGE_ALIGN(size + offset); > > area = get_vm_area_caller(size, VM_IOREMAP, > @@ -33,7 +33,7 @@ void __iomem *ioremap_prot(phys_addr_t addr, size_t size, unsigned long prot) > return NULL; > vaddr = (unsigned long)area->addr; > > - if (ioremap_page_range(vaddr, vaddr + size, addr, __pgprot(prot))) { > + if (ioremap_page_range(vaddr, vaddr + size, phys_addr, __pgprot(prot))) { > free_vm_area(area); > return NULL; > }