Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp155256iob; Mon, 2 May 2022 15:46:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLM2usQS44eUXf1V7YnCJO7CyzwGCV5eTRz+2dDUT4izx7JMpx3Ay9qfvaINcCbNgBQUcp X-Received: by 2002:ac2:5f4d:0:b0:448:7d37:5838 with SMTP id 13-20020ac25f4d000000b004487d375838mr9993234lfz.419.1651531567560; Mon, 02 May 2022 15:46:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651531567; cv=none; d=google.com; s=arc-20160816; b=s+GhUCyAg4IoM/Ppx8dh/FBotZS6txNnU2cT3DcdbBIiGyHciXBv6X1DEhsBKSXivv AvksPzPADAe8itPp7c8tuhrl7QyyGY2VbQRyf+wkt81Y9igYk+G/OF0ElGw1x45RZoAY EuyBNKG/iybnG83+FYh0iqD5peAOtq9ly+hYtg5fkdff71eeG8HBBvjXtaMqHkvqlMSi Tp2QLa7Izif0pY/DZ7C7uM7ablX8uqHT8tfKwRTUtyK9V4bH4fMpFI5tvQlIF884hTIw 9PhHlsKw5DvUkMS5tcoiE1p/TJeKKoCIBiXRYK2pKgxWFB9HyGlLa7CK1ngg/4s+DOEM Pb6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=vTAJA4albyLbzmA9YSZTepZif4TeLmR+8lPdwxxlCt4=; b=UXgNVXp+Kqoa542IvufwOpWTMZhkRaU4+1/wDOMWdhy7TAFCkoR5TFg2y5VfCJ8Skm ZtotJpj2X7mn6ZmSNTTpBRdzHL1RetQrDmPy2CTobFHAIowJIvM0F7v3MsEIAlWA1WHx eKdI+zhdr1PLppTVHbLtr9F6BSTiWa/UefReDC7UzW/WRlgeiN/qVYfLFFb3xtjwlqCr PMZVGjUraomkEnVPen8M81kyB0XWROSIrIz17hB3JddCSLVSSxcmOzee0y3wdS6M0BjI BpEQMxrWMdCzGVCqxKJZTrloF/jpqpqOzGzC9rx4WDBXdXHZd1S7DU19znzeGurhgnHC Rs2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a18-20020a194f52000000b00449fff28225si15049981lfk.423.2022.05.02.15.45.40; Mon, 02 May 2022 15:46:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384074AbiEBJlM (ORCPT + 99 others); Mon, 2 May 2022 05:41:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1384251AbiEBJlJ (ORCPT ); Mon, 2 May 2022 05:41:09 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9CCBCE09B for ; Mon, 2 May 2022 02:37:40 -0700 (PDT) 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-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; > }