From patchwork Wed Dec 7 12:33:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 87080 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp290990qgi; Wed, 7 Dec 2016 04:35:59 -0800 (PST) X-Received: by 10.107.21.2 with SMTP id 2mr56973247iov.179.1481114159275; Wed, 07 Dec 2016 04:35:59 -0800 (PST) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id i63si17254914ioa.72.2016.12.07.04.35.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Dec 2016 04:35:59 -0800 (PST) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cEbQE-00067O-L0; Wed, 07 Dec 2016 12:34:06 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cEbQD-000668-Q5 for xen-devel@lists.xen.org; Wed, 07 Dec 2016 12:34:05 +0000 Received: from [85.158.143.35] by server-6.bemta-6.messagelabs.com id 7C/18-28843-DB108485; Wed, 07 Dec 2016 12:34:05 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGLMWRWlGSWpSXmKPExsVysyfVTXcPo0e EQctfLYslHxezODB6HN39mymAMYo1My8pvyKBNWPRu6VMBRNFKm48fMfawHhCoIuRi0NIYDOj xOuulcwQzmlGiafrFzJ2MXJysAloStz5/IkJxBYRkJa49vkyWJxZwEHizcd7LCC2MJC9+9QlV hCbRUBV4tyZJWwgNq+Ai8S+jtNgtoSAnMTJY5PBajgFXCVuff0L1isEVPO1aRnLBEbuBYwMqx jVi1OLylKLdI31kooy0zNKchMzc3QNDcz0clOLixPTU3MSk4r1kvNzNzEC/csABDsYO/45HWK U5GBSEuXdNcE9QogvKT+lMiOxOCO+qDQntfgQowwHh5IErzAwXIQEi1LTUyvSMnOAgQaTluDg URLh3fcfqJW3uCAxtzgzHSJ1ilFRSpyXA6RPACSRUZoH1wYL7kuMslLCvIxAhwjxFKQW5WaWo Mq/YhTnYFQS5v3NADSFJzOvBG76K6DFTECL590AW1ySiJCSamCcOqXyq17DZO3FIhZ2R94ckv h8kHVdXmN68pVf31bN73hzeuVjsT9zXe/JSX14aZTUKT37gRLPwhlrl63c8NpzcX3BHgP/Waq Jfau/Xr0W5ySsxKm0RnCfmsKkq36TA4XdD2Q9k2GI65Y4+de6z9tJy32ikLnz3R3zPWay+4kc /b+Qp/vd1iI5JZbijERDLeai4kQA5yFjS2kCAAA= X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-6.tower-21.messagelabs.com!1481114043!24053095!2 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.0.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 46728 invoked from network); 7 Dec 2016 12:34:04 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-6.tower-21.messagelabs.com with SMTP; 7 Dec 2016 12:34:04 -0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4FC6F152D; Wed, 7 Dec 2016 04:34:04 -0800 (PST) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.218.32]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AD4D73F477; Wed, 7 Dec 2016 04:34:03 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Wed, 7 Dec 2016 12:33:44 +0000 Message-Id: <1481114033-11024-5-git-send-email-julien.grall@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1481114033-11024-1-git-send-email-julien.grall@arm.com> References: <1481114033-11024-1-git-send-email-julien.grall@arm.com> Cc: Julien Grall , sstabellini@kernel.org Subject: [Xen-devel] [PATCH 04/13] xen/arm: vgic: Switch from bool_t to bool X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" Since commit 9202342 "xen/build: Use C99 booleans", bool_t is an alias to bool. Going forward, therer is a preference to use bool rather than bool_t. Also replace 0 and 1 by false and true when relevant. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- xen/arch/arm/vgic.c | 8 ++++---- xen/include/asm-arm/vgic.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c index 0965119..84735a9 100644 --- a/xen/arch/arm/vgic.c +++ b/xen/arch/arm/vgic.c @@ -482,7 +482,7 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int virq) uint8_t priority; struct pending_irq *iter, *n = irq_to_pending(v, virq); unsigned long flags; - bool_t running; + bool running; priority = vgic_get_virq_priority(v, virq); @@ -555,15 +555,15 @@ int vgic_emulate(struct cpu_user_regs *regs, union hsr hsr) return v->domain->arch.vgic.handler->emulate_sysreg(regs, hsr); } -bool_t vgic_reserve_virq(struct domain *d, unsigned int virq) +bool vgic_reserve_virq(struct domain *d, unsigned int virq) { if ( virq >= vgic_num_irqs(d) ) - return 0; + return false; return !test_and_set_bit(virq, d->arch.vgic.allocated_irqs); } -int vgic_allocate_virq(struct domain *d, bool_t spi) +int vgic_allocate_virq(struct domain *d, bool spi) { int first, end; unsigned int virq; diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h index 300f461..1f371c8 100644 --- a/xen/include/asm-arm/vgic.h +++ b/xen/include/asm-arm/vgic.h @@ -315,23 +315,23 @@ extern int vgic_to_sgi(struct vcpu *v, register_t sgir, extern void vgic_migrate_irq(struct vcpu *old, struct vcpu *new, unsigned int irq); /* Reserve a specific guest vIRQ */ -extern bool_t vgic_reserve_virq(struct domain *d, unsigned int virq); +extern bool vgic_reserve_virq(struct domain *d, unsigned int virq); /* * Allocate a guest VIRQ * - spi == 0 => allocate a PPI. It will be the same on every vCPU * - spi == 1 => allocate an SPI */ -extern int vgic_allocate_virq(struct domain *d, bool_t spi); +extern int vgic_allocate_virq(struct domain *d, bool spi); static inline int vgic_allocate_ppi(struct domain *d) { - return vgic_allocate_virq(d, 0 /* ppi */); + return vgic_allocate_virq(d, false /* ppi */); } static inline int vgic_allocate_spi(struct domain *d) { - return vgic_allocate_virq(d, 1 /* spi */); + return vgic_allocate_virq(d, true /* spi */); } extern void vgic_free_virq(struct domain *d, unsigned int virq);