Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp330660pxa; Wed, 5 Aug 2020 02:13:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXGxvVUIbFg3sYtrQcNRfNO/rslrPOq6Q/jpfYjAl/TZdXZnusbRffTIRG3uheLrcpF+ag X-Received: by 2002:a17:906:a413:: with SMTP id l19mr2273078ejz.15.1596618793107; Wed, 05 Aug 2020 02:13:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596618793; cv=none; d=google.com; s=arc-20160816; b=SovWIqeNFnFrqQTjLYg7dQMZhtctC5iuFHfIZfPeOcRyMqA89KcBoIXp8J96Iodwco FsfE2PYMWUEmn4qmg3tgF5bheUkdAK1AHmWNuWmoeGQsxd2mZIasO5Iwjs1Ox94Kwday QLYc+f6Sx2kQTInlwgW8nVSvj59jdWyOEkdgz1GKCAdFaU0rX1mNPAbjE7wbz8acVamD PHzHvFk+ojZogx/dnJz7mmIwzq2QZ1KF1G29TFaEOUKQvd2cDB/BR0bVtFMSbTKfxfZY /RdqcQ2Yc/SW/50wZ+out69kR8X0Z2OyfTo4nl/3SM2yH8pDqoA8gXOmZscK7rewJTXJ rCFg== 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=4ozBDa1/xPHY8DQkaA9JqUMmSyVVQ14zD1Crd0znMso=; b=pXhuw4LayXrw3cjV0Z84loNDhRellbwy7z0FtmHC1lrfS9BBLBwpz4ElGUu9pkJ6dN d5EQ5b6v4eVF8P6Ko7iK0IIJWwyZ2vQPy27s/2oOf+48BnjksmcAKChjoJQHclmleFN9 nU7VTEegOZDtOFgrICWhOZOa97mrsfT8QpjEmONrmQHA21sBA7fDsdVbmPTvx4RUBXzk i9yOoMmbs13PwA4AxZglJL2YRTqJ4QRKe1iXmbezlNyWcjaOjRR9UxJ8l/5WNo18IGIF 3hkr9ZlXdmSyRsTQILvvaIqKbQirCs8W8tKIcg+SWEZwAdWNgbf/yzvudCAdp7C8UyWF qEkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PKa1vVZ2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q22si837061eds.346.2020.08.05.02.12.43; Wed, 05 Aug 2020 02:13:13 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PKa1vVZ2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726459AbgHEJLz (ORCPT + 99 others); Wed, 5 Aug 2020 05:11:55 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:56296 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728383AbgHEJLV (ORCPT ); Wed, 5 Aug 2020 05:11:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596618680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4ozBDa1/xPHY8DQkaA9JqUMmSyVVQ14zD1Crd0znMso=; b=PKa1vVZ2ktwBbfJkH7uBUaodNzgQ70N4m/jCCX7g/UIAZUY8lbCvw7c9g+fCCXqVyht8ex 9nC4o/YKAN4lSfzxNsQjmVN66prsFkDwEUcJYUhezxiXCa9yG0tA9vq0Ik9tc6LfFXIAx8 0LsaCfLZyY43EVbe7qQasoabcd3WOxU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-16-yG35Dv0sMVyPaqKEAb-z_A-1; Wed, 05 Aug 2020 05:11:16 -0400 X-MC-Unique: yG35Dv0sMVyPaqKEAb-z_A-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DB37818C63C1; Wed, 5 Aug 2020 09:11:11 +0000 (UTC) Received: from localhost (ovpn-12-71.pek2.redhat.com [10.72.12.71]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E2D2772E4F; Wed, 5 Aug 2020 09:11:07 +0000 (UTC) Date: Wed, 5 Aug 2020 17:11:05 +0800 From: Baoquan He To: Mike Rapoport Cc: Andrew Morton , Andy Lutomirski , 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 16/17] memblock: implement for_each_reserved_mem_region() using __next_mem_region() Message-ID: <20200805091105.GW10792@MiWiFi-R3L-srv> References: <20200802163601.8189-1-rppt@kernel.org> <20200802163601.8189-17-rppt@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200802163601.8189-17-rppt@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/02/20 at 07:36pm, Mike Rapoport wrote: > From: Mike Rapoport > > Iteration over memblock.reserved with for_each_reserved_mem_region() used > __next_reserved_mem_region() that implemented a subset of > __next_mem_region(). > > Use __for_each_mem_range() and, essentially, __next_mem_region() with > appropriate parameters to reduce code duplication. > > While on it, rename for_each_reserved_mem_region() to > for_each_reserved_mem_range() for consistency. > > Signed-off-by: Mike Rapoport > --- > .clang-format | 2 +- > arch/arm64/kernel/setup.c | 2 +- > drivers/irqchip/irq-gic-v3-its.c | 2 +- > include/linux/memblock.h | 12 +++------ > mm/memblock.c | 46 +++++++------------------------- > 5 files changed, 17 insertions(+), 47 deletions(-) Reviewed-by: Baoquan He