From patchwork Mon Jul 22 03:20:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Gang X-Patchwork-Id: 2831005 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CFC839F9CC for ; Mon, 22 Jul 2013 03:21:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E5F1420131 for ; Mon, 22 Jul 2013 03:21:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 06DDA20111 for ; Mon, 22 Jul 2013 03:21:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755047Ab3GVDVM (ORCPT ); Sun, 21 Jul 2013 23:21:12 -0400 Received: from intranet.asianux.com ([58.214.24.6]:6857 "EHLO intranet.asianux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754761Ab3GVDVL (ORCPT ); Sun, 21 Jul 2013 23:21:11 -0400 Received: by intranet.asianux.com (Postfix, from userid 103) id 8B84E184024E; Mon, 22 Jul 2013 11:21:10 +0800 (CST) X-Spam-Score: -100.8 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from [10.1.0.143] (unknown [219.143.36.82]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by intranet.asianux.com (Postfix) with ESMTP id 198C6184024E; Mon, 22 Jul 2013 11:21:10 +0800 (CST) Message-ID: <51ECA4EC.3000408@asianux.com> Date: Mon, 22 Jul 2013 11:20:12 +0800 From: Chen Gang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: christoffer.dall@linaro.org, Gleb Natapov , pbonzini@redhat.com CC: Russell King - ARM Linux , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, "linux-arm-kernel@lists.infradead.org" , Catalin Marinas , Will Deacon Subject: [PATCH] ARM(64): KVM: add signed type cast for comparation Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 'len' is 'unsigned long' which is never less than zero. So need a related type cast for comparation. The related warning (when building ARM64 with allmodconfig): arch/arm64/kvm/../../../arch/arm/kvm/mmio.c:82:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] Signed-off-by: Chen Gang --- arch/arm/kvm/mmio.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/arm/kvm/mmio.c b/arch/arm/kvm/mmio.c index b8e06b7..626dfc8 100644 --- a/arch/arm/kvm/mmio.c +++ b/arch/arm/kvm/mmio.c @@ -79,7 +79,7 @@ static int decode_hsr(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, } len = kvm_vcpu_dabt_get_as(vcpu); - if (unlikely(len < 0)) + if (unlikely((long)len < 0)) return len; is_write = kvm_vcpu_dabt_iswrite(vcpu);