From patchwork Tue Sep 22 00:21:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 53989 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by patches.linaro.org (Postfix) with ESMTPS id CAFDB22EBD for ; Tue, 22 Sep 2015 00:23:48 +0000 (UTC) Received: by wicgb1 with SMTP id gb1sf374366wic.3 for ; Mon, 21 Sep 2015 17:23:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:cc:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=ZHjW6O5M1P8o+wGrYRDSI2fhRw18TbWxsnbRm+EyqME=; b=Bu84Ye0tkfOOHC5DwG41yLYJ4yeA2rwr1TrnbK8UoWSCtktlPGC1uwFKK8pEiENwzP SCxnMZfMccZY/aX2Zzg3PSjWB+VIT+GIrycnJ6l+aK3CtXD6azJ6Zy2UmEQRCD8Cygmn dh/Our8bFpblBYZZtNx5bXMbrrpJxll7suof7PS9L+GF4bdfVW2r+64NG+2J18CXfVLc GLTABbsoM3LwzrUW4DCmacxN4djKtEV+NX9QjiUvDggczxdofY+V3asJ4mDy2CSoXV9A MmljkyzXZuNvGXYkixWtsHyAt+bN1pkCg9KM/2JtQi+Pj1BeOy+PSAyazbGit2UkOanT epdA== X-Gm-Message-State: ALoCoQlZBG7wwW1majk9s8QbK5fpeXqkOK63vn0CD0lNt5lj8gwQtu6XJRs2Jch9o+DU/op08Yei X-Received: by 10.180.107.167 with SMTP id hd7mr2556187wib.6.1442881428130; Mon, 21 Sep 2015 17:23:48 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.21.229 with SMTP id 98ls31054lfv.97.gmail; Mon, 21 Sep 2015 17:23:47 -0700 (PDT) X-Received: by 10.25.91.4 with SMTP id p4mr1944803lfb.95.1442881427840; Mon, 21 Sep 2015 17:23:47 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id dl10si17749207lad.154.2015.09.21.17.23.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Sep 2015 17:23:47 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by lanb10 with SMTP id b10so78074002lan.3 for ; Mon, 21 Sep 2015 17:23:47 -0700 (PDT) X-Received: by 10.152.21.196 with SMTP id x4mr8756162lae.86.1442881427393; Mon, 21 Sep 2015 17:23:47 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp178828lbq; Mon, 21 Sep 2015 17:23:46 -0700 (PDT) X-Received: by 10.180.106.66 with SMTP id gs2mr16907763wib.14.1442881426308; Mon, 21 Sep 2015 17:23:46 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id fw8si34806918wjb.44.2015.09.21.17.23.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Sep 2015 17:23:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZeBLf-0001HY-W4; Tue, 22 Sep 2015 00:22:20 +0000 Received: from mail-pa0-f43.google.com ([209.85.220.43]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZeBLV-000197-Fi for linux-arm-kernel@lists.infradead.org; Tue, 22 Sep 2015 00:22:10 +0000 Received: by padbj2 with SMTP id bj2so5631611pad.3 for ; Mon, 21 Sep 2015 17:21:48 -0700 (PDT) X-Received: by 10.66.246.162 with SMTP id xx2mr27586750pac.144.1442881308711; Mon, 21 Sep 2015 17:21:48 -0700 (PDT) Received: from localhost.localdomain ([70.35.39.2]) by smtp.gmail.com with ESMTPSA id xv12sm26924984pac.38.2015.09.21.17.21.45 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Sep 2015 17:21:47 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, leif.lindholm@linaro.org, mark.rutland@arm.com, catalin.marinas@arm.com, will.deacon@arm.com, msalter@redhat.com Subject: [PATCH v3 1/6] of/fdt: make generic early_init_dt_add_memory_arch() a weak alias Date: Mon, 21 Sep 2015 17:21:23 -0700 Message-Id: <1442881288-13962-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442881288-13962-1-git-send-email-ard.biesheuvel@linaro.org> References: <1442881288-13962-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150921_172209_668418_EDAB7BEF X-CRM114-Status: GOOD ( 13.73 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.220.43 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.220.43 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Cc: Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 The function early_init_dt_add_memory_arch() is defined as __weak so that archs can override it. However, in this override implementation, it may still be useful to invoke the generic implementation, so instead, rename the generic version to early_init_dt_add_memory() and turn the original definition into a weak alias. This way, the generic version can still be called even in the presence of an arch specific override. Signed-off-by: Ard Biesheuvel --- drivers/of/fdt.c | 7 +++++-- include/linux/of_fdt.h | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 07496560e5b9..8b758e10c9f8 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -969,7 +969,7 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname, #ifdef CONFIG_HAVE_MEMBLOCK #define MAX_PHYS_ADDR ((phys_addr_t)~0) -void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size) +void __init early_init_dt_add_memory(u64 base, u64 size) { const u64 phys_offset = __pa(PAGE_OFFSET); @@ -1027,7 +1027,7 @@ void * __init __weak early_init_dt_alloc_memory_arch(u64 size, u64 align) return __va(memblock_alloc(size, align)); } #else -void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size) +void __init early_init_dt_add_memory(u64 base, u64 size) { WARN_ON(1); } @@ -1047,6 +1047,9 @@ void * __init __weak early_init_dt_alloc_memory_arch(u64 size, u64 align) } #endif +__weak __alias(early_init_dt_add_memory) +void early_init_dt_add_memory_arch(u64 base, u64 size); + bool __init early_init_dt_verify(void *params) { if (!params) diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h index df9ef3801812..463a06ba87ac 100644 --- a/include/linux/of_fdt.h +++ b/include/linux/of_fdt.h @@ -65,6 +65,7 @@ extern int early_init_dt_scan_memory(unsigned long node, const char *uname, int depth, void *data); extern void early_init_fdt_scan_reserved_mem(void); extern void early_init_fdt_reserve_self(void); +extern void early_init_dt_add_memory(u64 base, u64 size); extern void early_init_dt_add_memory_arch(u64 base, u64 size); extern int early_init_dt_reserve_memory_arch(phys_addr_t base, phys_addr_t size, bool no_map);