From patchwork Tue Apr 3 08:10:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10320791 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3FFBA60390 for ; Tue, 3 Apr 2018 08:11:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 329A828971 for ; Tue, 3 Apr 2018 08:11:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 27381289CD; Tue, 3 Apr 2018 08:11:02 +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=-6.9 required=2.0 tests=BAYES_00,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 9917128971 for ; Tue, 3 Apr 2018 08:11:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755017AbeDCIK5 (ORCPT ); Tue, 3 Apr 2018 04:10:57 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:45784 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754991AbeDCIKz (ORCPT ); Tue, 3 Apr 2018 04:10:55 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 596634057281 for ; Tue, 3 Apr 2018 08:10:55 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-115.ams2.redhat.com [10.36.116.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id C2CAF2026DFD; Tue, 3 Apr 2018 08:10:53 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org Cc: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [kvm-unit-tests PATCH] lib/alloc: Fix/check the prototypes in the allocator files Date: Tue, 3 Apr 2018 10:10:52 +0200 Message-Id: <1522743052-8266-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 03 Apr 2018 08:10:55 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 03 Apr 2018 08:10:55 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We should make sure that the prototypes match the implementations and thus include the alloc_page.h header from alloc_page.c, and the alloc_phys.h header from alloc_phys.c. This way the file can be compiled with -Wmissing-prototypes and -Wstrict-prototypes, too. Signed-off-by: Thomas Huth Reviewed-by: David Hildenbrand --- lib/alloc_page.c | 1 + lib/alloc_page.h | 2 +- lib/alloc_phys.c | 1 + lib/vmalloc.h | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/alloc_page.c b/lib/alloc_page.c index 361b584..730f2b5 100644 --- a/lib/alloc_page.c +++ b/lib/alloc_page.c @@ -7,6 +7,7 @@ #include "libcflat.h" #include "alloc.h" #include "alloc_phys.h" +#include "alloc_page.h" #include "bitops.h" #include #include diff --git a/lib/alloc_page.h b/lib/alloc_page.h index 51d4841..5cdfec5 100644 --- a/lib/alloc_page.h +++ b/lib/alloc_page.h @@ -10,7 +10,7 @@ bool page_alloc_initialized(void); void page_alloc_ops_enable(void); -void *alloc_page(); +void *alloc_page(void); void *alloc_pages(unsigned long order); void free_page(void *page); void free_pages(void *mem, unsigned long size); diff --git a/lib/alloc_phys.c b/lib/alloc_phys.c index 736c312..72e20f7 100644 --- a/lib/alloc_phys.c +++ b/lib/alloc_phys.c @@ -9,6 +9,7 @@ #include "alloc.h" #include "asm/spinlock.h" #include "asm/io.h" +#include "alloc_phys.h" #define PHYS_ALLOC_NR_REGIONS 256 diff --git a/lib/vmalloc.h b/lib/vmalloc.h index b4cde65..3658b80 100644 --- a/lib/vmalloc.h +++ b/lib/vmalloc.h @@ -6,7 +6,7 @@ extern void *alloc_vpages(ulong nr); extern void *alloc_vpage(void); extern void init_alloc_vpage(void *top); -extern void setup_vm(); +extern void setup_vm(void); extern void *setup_mmu(phys_addr_t top); extern phys_addr_t virt_to_pte_phys(pgd_t *pgtable, void *virt);