From patchwork Tue Apr 23 15:58:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 16366 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f197.google.com (mail-ye0-f197.google.com [209.85.213.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 44C6523A3C for ; Tue, 23 Apr 2013 15:59:30 +0000 (UTC) Received: by mail-ye0-f197.google.com with SMTP id q9sf1212023yen.4 for ; Tue, 23 Apr 2013 08:58:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=gVOZSXVW3ZSvrTH+eyiZjmeeG4CSpazvAWjY3cDhXoA=; b=dMTH0ES8viP2BbhwSGTo00mqxHdNsShUQfOmqNeTPnNotTLlnCdY6eClnkoxPrXmpO m4NLduKTFZqnWgohK7JgzQ7krbBYE5TDAdpJH78G2QIoVTTJXeZBVbFvmQWKKGZu86z+ xElgjAt62ti2pGburN6zZ7HJm/gf6Ky5y1BBfIORtmUhb9GXExURsZtwHKyfbe9/yHK8 5iQ4SKkotMtEL3gqqmwfbYNqPM3s2LtoC6kkXbuTEyCHHOBfRX05UIU2wOBtygPBpmBB Ia5iYKv5NHkTpjLwfnjpK6tOBGTbUbserwPp0iujJkJCSpopWRnNa1nWJ+uct79Ah9Dm y6bg== X-Received: by 10.236.89.65 with SMTP id b41mr15463579yhf.49.1366732720923; Tue, 23 Apr 2013 08:58:40 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.1.4 with SMTP id 4ls457316qei.68.gmail; Tue, 23 Apr 2013 08:58:40 -0700 (PDT) X-Received: by 10.220.155.8 with SMTP id q8mr16974165vcw.42.1366732720772; Tue, 23 Apr 2013 08:58:40 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id gr7si3135503vdc.38.2013.04.23.08.58.40 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Apr 2013 08:58:40 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id gf12so784458vcb.18 for ; Tue, 23 Apr 2013 08:58:40 -0700 (PDT) X-Received: by 10.58.48.166 with SMTP id m6mr9971878ven.59.1366732720633; Tue, 23 Apr 2013 08:58:40 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp131966veb; Tue, 23 Apr 2013 08:58:40 -0700 (PDT) X-Received: by 10.180.79.69 with SMTP id h5mr39374016wix.14.1366732719558; Tue, 23 Apr 2013 08:58:39 -0700 (PDT) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id d4si6103574wjr.82.2013.04.23.08.58.39 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 23 Apr 2013 08:58:39 -0700 (PDT) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1UUfc5-00057U-Jb; Tue, 23 Apr 2013 16:58:37 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org Subject: [PATCH] target-arm: Fix incorrect check of kvm_vcpu_ioctl return value Date: Tue, 23 Apr 2013 16:58:37 +0100 Message-Id: <1366732717-19657-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 X-Gm-Message-State: ALoCoQlKmWRGKp1QoKbUKsAqzjgK1xV3XImXMVfwcRpRvBpuIGeWoE3bk5d9QlvCSSDzlL88ePSe X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , kvm_vcpu_ioctl() returns -ETHING on error, not ETHING -- correct an incorrect check in kvm_arch_init_vcpu(). This would not have had any significant ill-effects -- we would just have propagated the less useful ENOENT up to the caller rather than the more accurate EINVAL in the unlikely case that the kernel didn't have VFP-D32 support. Signed-off-by: Peter Maydell --- Pretty trivial bugfix, noticed while I was doing something to the code in this area... target-arm/kvm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target-arm/kvm.c b/target-arm/kvm.c index d8acace..b7bdc03 100644 --- a/target-arm/kvm.c +++ b/target-arm/kvm.c @@ -62,8 +62,8 @@ int kvm_arch_init_vcpu(CPUState *cs) r.id = KVM_REG_ARM | KVM_REG_SIZE_U64 | KVM_REG_ARM_VFP | 31; r.addr = (uintptr_t)(&v); ret = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &r); - if (ret == ENOENT) { - return EINVAL; + if (ret == -ENOENT) { + return -EINVAL; } return ret; }