From patchwork Mon Jan 21 08:03:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 10772895 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3491F1390 for ; Mon, 21 Jan 2019 08:05:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2224B28524 for ; Mon, 21 Jan 2019 08:05:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 124B229DCB; Mon, 21 Jan 2019 08:05:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C2C928524 for ; Mon, 21 Jan 2019 08:05:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4F5F28E001A; Mon, 21 Jan 2019 03:05:01 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 456B18E0018; Mon, 21 Jan 2019 03:05:01 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2F7B98E001A; Mon, 21 Jan 2019 03:05:01 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by kanga.kvack.org (Postfix) with ESMTP id ED8258E0018 for ; Mon, 21 Jan 2019 03:05:00 -0500 (EST) Received: by mail-qk1-f199.google.com with SMTP id c71so18265660qke.18 for ; Mon, 21 Jan 2019 00:05:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:in-reply-to:references:message-id; bh=FYxL+Gx8/eWyTMBRz02PQ7a3S1+ZxlvJeU+uwE8EZ9g=; b=rmkKM18Q96IN03+Zr0aamycbK130iKJ71RIew6K7jBjG5Pm0PHuKqnIr0ozG+P5+0p DJFaNlQzu7G9JZAi1ryrGQG3MHtD5MQcceArpCXlxIK3j4dKNgllBKzqjF8X8sQxywtB utxDtv34EvoyN+y2fuNf6M1yqmNjU8+yTjgaOvdX+fI2gY8z5dWnR1OPLKfUETeCOSt5 0VNA+yWfYgzAKRXAzk5jUpVoLzTRwAVm2xhqQJCBWjXyjofMXLQTky5NQ9GxjtdLFx5+ zmXrtR3cyc4WOWhT9YmGAqw1a+YzRSqh/09cDoKoNgVQm1XInGlvDg1nZ6onyCp6I9N2 ZLxA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of rppt@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=rppt@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com X-Gm-Message-State: AJcUukeXEQJr4eXnuS7JrWPBV7mxRN4cg8DfVMMhMQPwXgx/mcv2ovtg LYTau6tJqxqW0sMlPvhtife26xfnrXdO2/JsBa5ykK4mxJJOl1r05t07nUBUNG671HWfF2EJWZ2 C2/HESNd39SwEOUJ0t9gkrhrSqcXnT6jDol3SKlp/GeSR448YVk+64cWcqhctaHmyWQ== X-Received: by 2002:aed:3a22:: with SMTP id n31mr25959512qte.29.1548057900738; Mon, 21 Jan 2019 00:05:00 -0800 (PST) X-Google-Smtp-Source: ALg8bN71HKaY2iT8cIcHdSTA4+wl0q6nSJ8MyGYBdHKhATuRvxxZFQhbtBlk4+0oYFDyUvgMxUM9 X-Received: by 2002:aed:3a22:: with SMTP id n31mr25959474qte.29.1548057900156; Mon, 21 Jan 2019 00:05:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548057900; cv=none; d=google.com; s=arc-20160816; b=WpsdX4TL6nwms/3P3rS4RA7cHllXADyd1VNqFuoqh3S9MnJRMAKh0wiiyxenIJvYsc IcSe5IaH+V1yManLjSoPxXdjGkWPnqvJLqzr2IKtczwN+KnvEMwM2wizKRUJdF5WXXp5 jrqxb6V1D8pg0YF4CHbhU97B9AXmFJwgsL2hI3VCyoMEyeGulbbc4q3/UzTt+Y0b1gJJ 66naUmBWgbs+vqC9fn6WY2hMaMCcmJ49saFigQdoShCm86tRfsBS0alEg5auQ69erXhY HgVQNia+kcDfzyU5WNNtxXMnLIbymWriEkeTszzD1O4fpbJhv8/HNoWeXYtfsfq61iBK /tsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:references:in-reply-to:date:subject:cc:to:from; bh=FYxL+Gx8/eWyTMBRz02PQ7a3S1+ZxlvJeU+uwE8EZ9g=; b=Ub8ammHUfoXSDsy8e4/CKlWHmDrZrJev3OK+nNMa56VOJk5pMZvNBD6bHt+lOtKW5a EFUEr5pewvKqWAQtcn40W8k46lIi4hteb2C/9KDnlsx4DYkyOxyOTox8Rw8RtGowlWTV neeQitli/JJi+z+zL+6/RnkF/ld1fqg0kO2GNTTZXofE7OD56/7x72MEmMT35BgWbnW+ VzmdnXiNVzt9dEtFuNk2nprmeWfI90AQU8BJ13codYfHdapfk3MhpMZpFWOGOUxyMp8W qd4wYbmZ20X9YVdGyI5tTPgxNBSS3+aKuzCn+t1HoQ1EN4oTRYJUCHm7MtElgAbDKIs1 QpMQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of rppt@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=rppt@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com. [148.163.158.5]) by mx.google.com with ESMTPS id c4si3024566qvo.215.2019.01.21.00.05.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Jan 2019 00:05:00 -0800 (PST) Received-SPF: pass (google.com: domain of rppt@linux.ibm.com designates 148.163.158.5 as permitted sender) client-ip=148.163.158.5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of rppt@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=rppt@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x0L83qgf072913 for ; Mon, 21 Jan 2019 03:04:59 -0500 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0b-001b2d01.pphosted.com with ESMTP id 2q580ddf9c-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 21 Jan 2019 03:04:59 -0500 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 21 Jan 2019 08:04:56 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 21 Jan 2019 08:04:45 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x0L84iB01638722 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 21 Jan 2019 08:04:44 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9E77911C05C; Mon, 21 Jan 2019 08:04:44 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ADE4611C04C; Mon, 21 Jan 2019 08:04:39 +0000 (GMT) Received: from rapoport-lnx (unknown [9.148.207.125]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Mon, 21 Jan 2019 08:04:39 +0000 (GMT) Received: by rapoport-lnx (sSMTP sendmail emulation); Mon, 21 Jan 2019 10:04:38 +0200 From: Mike Rapoport To: linux-mm@kvack.org Cc: Andrew Morton , Catalin Marinas , Christoph Hellwig , "David S. Miller" , Dennis Zhou , Geert Uytterhoeven , Greentime Hu , Greg Kroah-Hartman , Guan Xuetao , Guo Ren , Heiko Carstens , Mark Salter , Matt Turner , Max Filippov , Michael Ellerman , Michal Simek , Paul Burton , Petr Mladek , Rich Felker , Richard Weinberger , Rob Herring , Russell King , Stafford Horne , Tony Luck , Vineet Gupta , Yoshinori Sato , devicetree@vger.kernel.org, kasan-dev@googlegroups.com, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-um@lists.infradead.org, linux-usb@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, xen-devel@lists.xenproject.org, Mike Rapoport Subject: [PATCH v2 05/21] memblock: emphasize that memblock_alloc_range() returns a physical address Date: Mon, 21 Jan 2019 10:03:52 +0200 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1548057848-15136-1-git-send-email-rppt@linux.ibm.com> References: <1548057848-15136-1-git-send-email-rppt@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19012108-0028-0000-0000-0000033BE16F X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19012108-0029-0000-0000-000023F9157E Message-Id: <1548057848-15136-6-git-send-email-rppt@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-01-21_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901210066 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: X-Virus-Scanned: ClamAV using ClamSMTP Rename memblock_alloc_range() to memblock_phys_alloc_range() to emphasize that it returns a physical address. While on it, remove the 'enum memblock_flags' parameter from this function as its only user anyway sets it to MEMBLOCK_NONE, which is the default for the most of memblock allocations. Signed-off-by: Mike Rapoport --- include/linux/memblock.h | 5 ++--- mm/cma.c | 10 ++++------ mm/memblock.c | 9 +++++---- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/include/linux/memblock.h b/include/linux/memblock.h index f7ef313..66dfdb3 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h @@ -369,6 +369,8 @@ static inline int memblock_get_region_node(const struct memblock_region *r) #define ARCH_LOW_ADDRESS_LIMIT 0xffffffffUL #endif +phys_addr_t memblock_phys_alloc_range(phys_addr_t size, phys_addr_t align, + phys_addr_t start, phys_addr_t end); phys_addr_t memblock_phys_alloc_nid(phys_addr_t size, phys_addr_t align, int nid); phys_addr_t memblock_phys_alloc_try_nid(phys_addr_t size, phys_addr_t align, int nid); @@ -487,9 +489,6 @@ static inline bool memblock_bottom_up(void) return memblock.bottom_up; } -phys_addr_t __init memblock_alloc_range(phys_addr_t size, phys_addr_t align, - phys_addr_t start, phys_addr_t end, - enum memblock_flags flags); phys_addr_t memblock_alloc_base(phys_addr_t size, phys_addr_t align, phys_addr_t max_addr); phys_addr_t __memblock_alloc_base(phys_addr_t size, phys_addr_t align, diff --git a/mm/cma.c b/mm/cma.c index c7b39dd..e4530ae 100644 --- a/mm/cma.c +++ b/mm/cma.c @@ -327,16 +327,14 @@ int __init cma_declare_contiguous(phys_addr_t base, * memory in case of failure. */ if (base < highmem_start && limit > highmem_start) { - addr = memblock_alloc_range(size, alignment, - highmem_start, limit, - MEMBLOCK_NONE); + addr = memblock_phys_alloc_range(size, alignment, + highmem_start, limit); limit = highmem_start; } if (!addr) { - addr = memblock_alloc_range(size, alignment, base, - limit, - MEMBLOCK_NONE); + addr = memblock_phys_alloc_range(size, alignment, base, + limit); if (!addr) { ret = -ENOMEM; goto err; diff --git a/mm/memblock.c b/mm/memblock.c index c80029e..f019aee 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -1338,12 +1338,13 @@ static phys_addr_t __init memblock_alloc_range_nid(phys_addr_t size, return 0; } -phys_addr_t __init memblock_alloc_range(phys_addr_t size, phys_addr_t align, - phys_addr_t start, phys_addr_t end, - enum memblock_flags flags) +phys_addr_t __init memblock_phys_alloc_range(phys_addr_t size, + phys_addr_t align, + phys_addr_t start, + phys_addr_t end) { return memblock_alloc_range_nid(size, align, start, end, NUMA_NO_NODE, - flags); + MEMBLOCK_NONE); } phys_addr_t __init memblock_phys_alloc_nid(phys_addr_t size, phys_addr_t align, int nid)