From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: [PATCH 12/34] xen/arm: psci: Don't need to check if vcpuid is negative Date: Tue, 25 Mar 2014 16:55:19 +0000 Message-ID: <1395766541-23979-13-git-send-email-julien.grall@linaro.org> References: <1395766541-23979-1-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WSUe7-0008QZ-Ga for xen-devel@lists.xenproject.org; Tue, 25 Mar 2014 16:56:15 +0000 Received: by mail-ee0-f47.google.com with SMTP id b15so681053eek.6 for ; Tue, 25 Mar 2014 09:56:13 -0700 (PDT) In-Reply-To: <1395766541-23979-1-git-send-email-julien.grall@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org vcpuid is unsigned int, therefore the value will never be negative. It fixes compilation with clang 3.5: vpsci.c:29:18: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare] if ( (vcpuid < 0) || (vcpuid >= MAX_VIRT_CPUS) ) ~~~~~~ ^ ~ Signed-off-by: Julien Grall Cc: Ian Campbell Cc: Stefano Stabellini Cc: Tim Deegan --- xen/arch/arm/vpsci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/arm/vpsci.c b/xen/arch/arm/vpsci.c index 1ceb8cb..abd3ade 100644 --- a/xen/arch/arm/vpsci.c +++ b/xen/arch/arm/vpsci.c @@ -26,7 +26,7 @@ int do_psci_cpu_on(uint32_t vcpuid, register_t entry_point) int rc; int is_thumb = entry_point & 1; - if ( (vcpuid < 0) || (vcpuid >= MAX_VIRT_CPUS) ) + if ( vcpuid >= MAX_VIRT_CPUS ) return PSCI_EINVAL; if ( vcpuid >= d->max_vcpus || (v = d->vcpu[vcpuid]) == NULL ) -- 1.7.10.4