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: 174292 Delivered-To: patch@linaro.org Received: by 2002:ac9:19ad:0:0:0:0:0 with SMTP id d45csp4107994oce; Tue, 24 Sep 2019 10:18:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOoAJ5xUdQSF8X43uzJUvlAwmuB0/s8v2WeUVLxYYxNS1/O4W1icpF94wyZTPT5bJ5Tn4A X-Received: by 2002:a5d:9908:: with SMTP id x8mr4652526iol.109.1569345518389; Tue, 24 Sep 2019 10:18:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569345518; cv=none; d=google.com; s=arc-20160816; b=C5asG/b22O0VCSggEAiF1UcrP5wrMZw2+IBreQklpExo7megnaa2iq8JLo2eghVqwg T8dwVO5y/XLPjZnryfANsvEkyZFmAicNnSZDFqFAhEW8ZWScYa+DPGMPcssoionAH81e qsZjOnI89AHE3y+FOJ1kynh3CyL5kF2GzzxmLdVPMYv8oWWifStdjFgb45UYqQIg6EH5 JOJrL8uSlZoOvuQBHmexlc1WOC2GxTXbzVXa4aMBsNcGGc++bq+syDzmfYIBK9Biaomy KWsruC2xyrJkaJCr9Nd4UjKSlFBiwz0YvCv6clCD79spm8q9zlYBVKciYg0kLg0CiUKF WqfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from; bh=7U3+LsLpnOY302daQi6C+XkUYDpiT9HYcJqXuXd7Hms=; b=iXufePGquZFPQAptUop+mTEYMDeqcElB7LwiCmLFx6OGaujem0C763ybxQKuy/l8NF LGT9Z11Q6mBAJE4HsTopoqohyh/eFlwXQ7sw3i7pjyVFBDbylW6LWvckvlIlUmx9wZIT dTjR3Dl2ZQaY8WYpP0RfO8SMQh0TGHipkI6UOnIsvj4UUS6qr8P1ASTNnE6Ji5sp4STx QZlJg4VpUFHNZQ/lOlHa5rS1GmGorSMgWxYCFSKWzp9tAm+3UNBUSvx83tCKY+gqYcL/ 2lUnhed081vR3pYBlwy5+CnOa7zy1N/Opx2ZbEh2bVsnM9O+SetOzsvxPb/ocu3rZX6Q oP9g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id n129si3117545iof.76.2019.09.24.10.18.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Sep 2019 10:18:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) 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__ */