From patchwork Tue Sep 24 17:17:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 11159275 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CE2EB1599 for ; Tue, 24 Sep 2019 17:18:30 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B3DA620673 for ; Tue, 24 Sep 2019 17:18:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B3DA620673 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iCoR6-0002af-Ln; Tue, 24 Sep 2019 17:17:12 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iCoR5-0002aW-7h for xen-devel@lists.xenproject.org; Tue, 24 Sep 2019 17:17:11 +0000 X-Inumbo-ID: 22b4a4f2-deef-11e9-bf31-bc764e2007e4 Received: from foss.arm.com (unknown [217.140.110.172]) by localhost (Halon) with ESMTP id 22b4a4f2-deef-11e9-bf31-bc764e2007e4; Tue, 24 Sep 2019 17:17:07 +0000 (UTC) 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 EEED3142F; Tue, 24 Sep 2019 10:17:06 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 625E53F694; Tue, 24 Sep 2019 10:17:06 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Tue, 24 Sep 2019 18:17:02 +0100 Message-Id: <20190924171702.25422-1-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH for-4.13] xen: sched: Fix Arm build after commit f855dd9625 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: jgross@suse.com, Julien Grall Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Commit f855dd9625 "sched: add minimalistic idle scheduler for free cpus" introduce the use of ZERO_BLOCK_PTR in the scheduler code. However, the define does not exist outside of xmalloc_tsf.c for non-x86 architecture. This will result to a compilation error on Arm: schedule.c: In function ‘sched_idle_alloc_vdata’: schedule.c:100:12: error: ‘ZERO_BLOCK_PTR’ undeclared (first use in this function) return ZERO_BLOCK_PTR; ^~~~~~~~~~~~~~ schedule.c:100:12: note: each undeclared identifier is reported only once for each function it appears in schedule.c:101:1: error: control reaches end of non-void function [-Werror=return-type] } ^ cc1: all warnings being treated as errors To avoid the compilation error, the default definition for ZERO_BLOCK_PTR is now moved in xen/config.h allowing all the code to use the define. Fixes: f855dd9625 ('sched: add minimalistic idle scheduler for free cpus') Signed-off-by: Julien Grall --- xen/common/xmalloc_tlsf.c | 5 ----- xen/include/xen/config.h | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xen/common/xmalloc_tlsf.c b/xen/common/xmalloc_tlsf.c index e98ad65455..1e8d72dea2 100644 --- a/xen/common/xmalloc_tlsf.c +++ b/xen/common/xmalloc_tlsf.c @@ -549,11 +549,6 @@ static void tlsf_init(void) * xmalloc() */ -#ifndef ZERO_BLOCK_PTR -/* Return value for zero-size allocation, distinguished from NULL. */ -#define ZERO_BLOCK_PTR ((void *)-1L) -#endif - void *_xmalloc(unsigned long size, unsigned long align) { void *p = NULL; diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h index a1d0f970a7..a106380a23 100644 --- a/xen/include/xen/config.h +++ b/xen/include/xen/config.h @@ -86,4 +86,9 @@ #define NDEBUG #endif +#ifndef ZERO_BLOCK_PTR +/* Return value for zero-size allocation, distinguished from NULL. */ +#define ZERO_BLOCK_PTR ((void *)-1L) +#endif + #endif /* __XEN_CONFIG_H__ */