Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp628596pxa; Wed, 5 Aug 2020 09:09:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylWnbj3DSgheU5Nl3Tbay4QIqOpz8zHBPVUJzoS1UxzD1yA9h5RcgfaMvV73jj/9cAQtH+ X-Received: by 2002:a17:906:858:: with SMTP id f24mr3770839ejd.543.1596643770624; Wed, 05 Aug 2020 09:09:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596643770; cv=none; d=google.com; s=arc-20160816; b=05uglZbHsUbRFo4g91cUgQDItwu00bMpYAiwog7SdVNf1/TFeorJeu9k4zMYLZse07 QPm5080Xhg+4Ko9kEKs5ziNk5w4qPkNRrQpX2dF70JM4IVARumULwHlzO1GuLoDP1Mx8 MnggEah2yKTkCyNGn5SZomavrr7oY59dv6DNFmSbJ02edU7WbYTxPaFww1BXHQyakucj artViThg0C97gvCBDdHuW2+LK0AoKtt0H3GL9MDyXlzbuw7a1PT/cn+NeD/BxJ7aVe9s g2Rzr0OOhXIPYpuyvvbiTEQ4aJH2a+XAr6yO2jIRMG3SzyBDkjuDOPDmXnTQgR2Bdnxi tyEw== 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; bh=Jo0dlNSdbcoLiJGCya4VP9uwEJBvzZumyye9AbXIQeE=; b=AG6M0N03CnFDIahCLHEk2NFSLhwypjEU2USP61Aq/q+l2uF5sM01KRz/EBJmnlWsfh NqC1v3kfi1XDICS1UaWrF7wdQbsnTWG73m6Lx5dhTh1wswnuxTNG9Ued7Ef/3Tx/5xsO dEbzBc+JltfBweETihM/mHAdEL/tPpRLkfb/g5VbqubR+9orm0qU0xQ7lDeQOfRrR/qq Uu9dTczzcqlbtp2V9/6DA0wUqT5Biafyx0t9IN9ZstF/GRcfQkiEoNRvxqEx2buCIV2m mej1QEeo1VrCET06K8BBQm1RRju9SzUBt/1h7gat6UXI498VolbesfcQkRVMOuGWQiak d+Ig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id um11si1537796ejb.117.2020.08.05.09.07.59; Wed, 05 Aug 2020 09:09:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726817AbgHEQDn (ORCPT + 99 others); Wed, 5 Aug 2020 12:03:43 -0400 Received: from elvis.franken.de ([193.175.24.41]:35580 "EHLO elvis.franken.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726027AbgHEPti (ORCPT ); Wed, 5 Aug 2020 11:49:38 -0400 Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1k3HAl-0001HW-01; Wed, 05 Aug 2020 13:01:27 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id 899DDC0C25; Wed, 5 Aug 2020 13:00:35 +0200 (CEST) Date: Wed, 5 Aug 2020 13:00:35 +0200 From: Thomas Bogendoerfer To: Mike Rapoport Cc: Andrew Morton , Andy Lutomirski , Baoquan He , Benjamin Herrenschmidt , Borislav Petkov , Catalin Marinas , Christoph Hellwig , Dave Hansen , Emil Renner Berthing , Ingo Molnar , Hari Bathini , Marek Szyprowski , Max Filippov , Michael Ellerman , Michal Simek , Mike Rapoport , Palmer Dabbelt , Paul Mackerras , Paul Walmsley , Peter Zijlstra , Russell King , Stafford Horne , Thomas Gleixner , Will Deacon , Yoshinori Sato , clang-built-linux@googlegroups.com, iommu@lists.linux-foundation.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-xtensa@linux-xtensa.org, linuxppc-dev@lists.ozlabs.org, openrisc@lists.librecores.org, sparclinux@vger.kernel.org, uclinux-h8-devel@lists.sourceforge.jp, x86@kernel.org Subject: Re: [PATCH v2 12/17] arch, drivers: replace for_each_membock() with for_each_mem_range() Message-ID: <20200805110035.GB11658@alpha.franken.de> References: <20200802163601.8189-1-rppt@kernel.org> <20200802163601.8189-13-rppt@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200802163601.8189-13-rppt@kernel.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 02, 2020 at 07:35:56PM +0300, Mike Rapoport wrote: > From: Mike Rapoport > > There are several occurrences of the following pattern: > > for_each_memblock(memory, reg) { > start = __pfn_to_phys(memblock_region_memory_base_pfn(reg); > end = __pfn_to_phys(memblock_region_memory_end_pfn(reg)); > > /* do something with start and end */ > } > > Using for_each_mem_range() iterator is more appropriate in such cases and > allows simpler and cleaner code. > > Signed-off-by: Mike Rapoport > --- > arch/mips/cavium-octeon/dma-octeon.c | 12 +++--- > arch/mips/kernel/setup.c | 31 +++++++-------- Acked-by: Thomas Bogendoerfer Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]