From patchwork Fri Sep 28 08:32:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10619153 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1D2B1174A for ; Fri, 28 Sep 2018 08:33:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10A3228497 for ; Fri, 28 Sep 2018 08:33:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04FD92863D; Fri, 28 Sep 2018 08:33:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D14928497 for ; Fri, 28 Sep 2018 08:33:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729223AbeI1Ozz (ORCPT ); Fri, 28 Sep 2018 10:55:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51582 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726971AbeI1Ozy (ORCPT ); Fri, 28 Sep 2018 10:55:54 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 58DAB8CD0; Fri, 28 Sep 2018 08:33:17 +0000 (UTC) Received: from thuth.com (ovpn-116-58.ams2.redhat.com [10.36.116.58]) by smtp.corp.redhat.com (Postfix) with ESMTP id A83E320155E2; Fri, 28 Sep 2018 08:33:15 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?b?UmFk?= =?utf-8?b?aW0gS3LEjW3DocWZ?= Cc: David Hildenbrand , Drew Jones , Janosch Frank Subject: [kvm-unit-tests PATCH 1/4] x86: Declare local functions as "static" and specify argument types Date: Fri, 28 Sep 2018 10:32:59 +0200 Message-Id: <1538123582-17442-2-git-send-email-thuth@redhat.com> In-Reply-To: <1538123582-17442-1-git-send-email-thuth@redhat.com> References: <1538123582-17442-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 28 Sep 2018 08:33:17 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This makes the code compilable with the compiler flags -Wstrict-prototypes and -Wmissing-prototypes. Signed-off-by: Thomas Huth --- x86/cmpxchg8b.c | 2 +- x86/tsc.c | 4 ++-- x86/umip.c | 6 +++--- x86/vmx.c | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/x86/cmpxchg8b.c b/x86/cmpxchg8b.c index 2e5a8e6..c56d295 100644 --- a/x86/cmpxchg8b.c +++ b/x86/cmpxchg8b.c @@ -17,7 +17,7 @@ static void test_cmpxchg8b(u32 *mem) report("cmpxchg8b", mem[0] == 3 && mem[1] == 4); } -int main() +int main(void) { setup_vm(); setup_idt(); diff --git a/x86/tsc.c b/x86/tsc.c index f841f03..6480a9c 100644 --- a/x86/tsc.c +++ b/x86/tsc.c @@ -8,7 +8,7 @@ static int check_cpuid_80000001_edx(unsigned int bit) } #define CPUID_7_0_ECX_RDPID (1 << 22) -int check_cpuid_7_0_ecx(unsigned int bit) +static int check_cpuid_7_0_ecx(unsigned int bit) { return (cpuid_indexed(7, 0).c & bit) != 0; } @@ -31,7 +31,7 @@ static void test_rdtscp(u64 aux) report("Test RDTSCP %" PRIu64, ecx == aux, aux); } -void test_rdpid(u64 aux) +static void test_rdpid(u64 aux) { u32 eax; diff --git a/x86/umip.c b/x86/umip.c index 149472d..5da6793 100644 --- a/x86/umip.c +++ b/x86/umip.c @@ -13,7 +13,7 @@ static unsigned long expected_rip; static int skip_count; static volatile int gp_count; -void gp_handler(struct ex_regs *regs) +static void gp_handler(struct ex_regs *regs) { if (regs->rip == expected_rip) { gp_count++; @@ -116,7 +116,7 @@ static void test_umip_gp(const char *msg) /* The ugly mode switching code */ -int do_ring3(void (*fn)(const char *), const char *arg) +static int do_ring3(void (*fn)(const char *), const char *arg) { static unsigned char user_stack[4096]; int ret; @@ -171,7 +171,7 @@ int do_ring3(void (*fn)(const char *), const char *arg) return ret; } -int main() +int main(void) { extern unsigned char kernel_entry; diff --git a/x86/vmx.c b/x86/vmx.c index b74ce6a..79a21d8 100644 --- a/x86/vmx.c +++ b/x86/vmx.c @@ -335,7 +335,7 @@ static bool check_all_vmcs_fields(u8 cookie) return pass; } -void test_vmwrite_vmread(void) +static void test_vmwrite_vmread(void) { struct vmcs *vmcs = alloc_page(); @@ -351,7 +351,7 @@ void test_vmwrite_vmread(void) free_page(vmcs); } -void test_vmcs_high(void) +static void test_vmcs_high(void) { struct vmcs *vmcs = alloc_page(); @@ -375,7 +375,7 @@ void test_vmcs_high(void) free_page(vmcs); } -void test_vmcs_lifecycle(void) +static void test_vmcs_lifecycle(void) { struct vmcs *vmcs[2] = {}; int i;