From patchwork Sun Mar 16 14:03:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 3839191 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 E84639F334 for ; Sun, 16 Mar 2014 14:13:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 15EA92010C for ; Sun, 16 Mar 2014 14:13:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B28692026D for ; Sun, 16 Mar 2014 14:13:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752443AbaCPONx (ORCPT ); Sun, 16 Mar 2014 10:13:53 -0400 Received: from qemu.weilnetz.de ([37.221.198.45]:58427 "EHLO v2201305906712890.yourvserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751809AbaCPONw (ORCPT ); Sun, 16 Mar 2014 10:13:52 -0400 X-Greylist: delayed 605 seconds by postgrey-1.27 at vger.kernel.org; Sun, 16 Mar 2014 10:13:52 EDT Received: by v2201305906712890.yourvserver.net (Postfix, from userid 1000) id 436B51800C1; Sun, 16 Mar 2014 15:03:42 +0100 (CET) From: Stefan Weil To: qemu-trivial@nongnu.org Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, =?UTF-8?q?Andreas=20F=C3=A4rber?= , Marcelo Tosatti , Paolo Bonzini , kvm@vger.kernel.org, Stefan Weil Subject: [PATCH] target-i386: Add missing 'static' and 'const' attributes Date: Sun, 16 Mar 2014 15:03:41 +0100 Message-Id: <1394978621-19738-1-git-send-email-sw@weilnetz.de> X-Mailer: git-send-email 1.7.10.4 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This fixes warnings from the static code analysis (smatch). Signed-off-by: Stefan Weil --- Why is array para_features in kvm.c terminated by a dummy entry? It is only used in a for loop with upper limit ARRAY_SIZE(para_features) - 1. Regards Stefan target-i386/cpu.c | 2 +- target-i386/kvm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index e7e62c5..8fd1497 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -316,7 +316,7 @@ typedef struct X86RegisterInfo32 { #define REGISTER(reg) \ [R_##reg] = { .name = #reg, .qapi_enum = X86_CPU_REGISTER32_##reg } -X86RegisterInfo32 x86_reg_info_32[CPU_NB_REGS32] = { +static const X86RegisterInfo32 x86_reg_info_32[CPU_NB_REGS32] = { REGISTER(EAX), REGISTER(ECX), REGISTER(EDX), diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 7a295f6..4389959 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -122,7 +122,7 @@ static struct kvm_cpuid2 *get_supported_cpuid(KVMState *s) return cpuid; } -struct kvm_para_features { +static const struct kvm_para_features { int cap; int feature; } para_features[] = {