From patchwork Wed Dec 7 12:33:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 87084 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp291001qgi; Wed, 7 Dec 2016 04:36:00 -0800 (PST) X-Received: by 10.107.8.201 with SMTP id h70mr59733709ioi.139.1481114160682; Wed, 07 Dec 2016 04:36:00 -0800 (PST) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id z206si17256196iof.194.2016.12.07.04.36.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Dec 2016 04:36:00 -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-00066Y-38; 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 1cEbQC-00065g-JJ for xen-devel@lists.xen.org; Wed, 07 Dec 2016 12:34:04 +0000 Received: from [85.158.143.35] by server-11.bemta-6.messagelabs.com id A8/8A-28490-BB108485; Wed, 07 Dec 2016 12:34:03 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGLMWRWlGSWpSXmKPExsVysyfVTXc3o0e Ewa0fMhZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8bd/k+sBa0CFdv2LmJqYPzG3cXIxSEksJlR 4sajv8wQzmlGibMHv7F1MXJysAloStz5/IkJxBYRkJa49vkyI4jNLOAg8ebjPRYQW1ggSeLGy ndgcRYBVYmDjzeC1fMKuEhceLUZbI6EgJzEyWOTWUFsTgFXiVtf/4L1CgHVfG1axjKBkXsBI8 MqRvXi1KKy1CJdY72kosz0jJLcxMwcXUMDM73c1OLixPTUnMSkYr3k/NxNjED/MgDBDsaOf06 HGCU5mJREeXdNcI8Q4kvKT6nMSCzOiC8qzUktPsQow8GhJMErDAwXIcGi1PTUirTMHGCgwaQl OHiURHj3/Qdq5S0uSMwtzkyHSJ1iVJQS5+UA6RMASWSU5sG1wYL7EqOslDAvI9AhQjwFqUW5m SWo8q8YxTkYlYR5fzMATeHJzCuBm/4KaDET0OJ5N8AWlyQipKQaGDlOeSdeEH61bb/P/O8CB+ bZWxSvYxLsF18wVyHXIvh2QNQeuTWlxUdso1mlb6e1CVd0vr+/3M+tIq4y8E9RDdvUK64/t4s tUF2asOhoVsnyD6Itm15uzZb/EtX4dmLa9j3ubdWfdczfhB1e5OTgkaFVdS1BRW7BxDXNTedO 7Nr8Xbjakv/NCyWW4oxEQy3mouJEAOohML1pAgAA X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-6.tower-21.messagelabs.com!1481114043!24053095!1 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 46433 invoked from network); 7 Dec 2016 12:34:03 -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:03 -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 9C51D154D; Wed, 7 Dec 2016 04:34:02 -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 088493F477; Wed, 7 Dec 2016 04:34:01 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Wed, 7 Dec 2016 12:33:42 +0000 Message-Id: <1481114033-11024-3-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 02/13] xen/arm: vtimer: Switch the read variable in the emulation from int 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" The read variable can only take two values: 1 => read, 0 => write. Use bool instead to make clear the variable can only take 2 values. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- xen/arch/arm/vtimer.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c index f8d3295..3fc97b3 100644 --- a/xen/arch/arm/vtimer.c +++ b/xen/arch/arm/vtimer.c @@ -164,7 +164,7 @@ int virt_timer_restore(struct vcpu *v) return 0; } -static bool vtimer_cntp_ctl(struct cpu_user_regs *regs, uint32_t *r, int read) +static bool vtimer_cntp_ctl(struct cpu_user_regs *regs, uint32_t *r, bool read) { struct vcpu *v = current; @@ -193,7 +193,8 @@ static bool vtimer_cntp_ctl(struct cpu_user_regs *regs, uint32_t *r, int read) return true; } -static bool vtimer_cntp_tval(struct cpu_user_regs *regs, uint32_t *r, int read) +static bool vtimer_cntp_tval(struct cpu_user_regs *regs, uint32_t *r, + bool read) { struct vcpu *v = current; s_time_t now; @@ -221,7 +222,8 @@ static bool vtimer_cntp_tval(struct cpu_user_regs *regs, uint32_t *r, int read) return true; } -static bool vtimer_cntp_cval(struct cpu_user_regs *regs, uint64_t *r, int read) +static bool vtimer_cntp_cval(struct cpu_user_regs *regs, uint64_t *r, + bool read) { struct vcpu *v = current; @@ -320,9 +322,9 @@ static bool vtimer_emulate_cp64(struct cpu_user_regs *regs, union hsr hsr) #ifdef CONFIG_ARM_64 typedef bool (*vtimer_sysreg32_fn_t)(struct cpu_user_regs *regs, uint32_t *r, - int read); + bool read); typedef bool (*vtimer_sysreg64_fn_t)(struct cpu_user_regs *regs, uint64_t *r, - int read); + bool read); static bool vtimer_emulate_sysreg32(struct cpu_user_regs *regs, union hsr hsr, vtimer_sysreg32_fn_t fn)