From patchwork Wed Jun 13 11:11:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10462033 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 8D50B60329 for ; Wed, 13 Jun 2018 11:11:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 816D22893D for ; Wed, 13 Jun 2018 11:11:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 748E428957; Wed, 13 Jun 2018 11:11:15 +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 D33D32896F for ; Wed, 13 Jun 2018 11:11:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935238AbeFMLLM (ORCPT ); Wed, 13 Jun 2018 07:11:12 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:34014 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S935121AbeFMLLK (ORCPT ); Wed, 13 Jun 2018 07:11:10 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6FA8C81663E7; Wed, 13 Jun 2018 11:11:10 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-24.ams2.redhat.com [10.36.116.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3A4B11C5B2; Wed, 13 Jun 2018 11:11:07 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Paolo Bonzini Cc: David Hildenbrand , Laurent Vivier , frankja@linux.ibm.com Subject: [kvm-unit-tests PULL 1/3] powerpc: Make code compilable with -Wmissing-prototypes Date: Wed, 13 Jun 2018 13:11:00 +0200 Message-Id: <1528888262-19694-2-git-send-email-thuth@redhat.com> In-Reply-To: <1528888262-19694-1-git-send-email-thuth@redhat.com> References: <1528888262-19694-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 13 Jun 2018 11:11:10 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 13 Jun 2018 11:11:10 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.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 It's always better to check whether the implementations match the prototypes, so make the code compilable with the -Wmissing-prototypes compiler flag. (However, the flag is not turned on yet since the other architectures are not ready for this yet) Reviewed-by: Laurent Vivier Signed-off-by: Thomas Huth --- lib/powerpc/asm/setup.h | 2 ++ lib/powerpc/hcall.c | 2 ++ lib/powerpc/io.c | 3 ++- lib/powerpc/io.h | 8 ++++++++ lib/powerpc/setup.c | 2 +- powerpc/reloc64.c | 2 ++ 6 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 lib/powerpc/io.h diff --git a/lib/powerpc/asm/setup.h b/lib/powerpc/asm/setup.h index 23b4156..cc7cf5e 100644 --- a/lib/powerpc/asm/setup.h +++ b/lib/powerpc/asm/setup.h @@ -27,4 +27,6 @@ extern unsigned __icache_bytes, __dcache_bytes; #define PHYSICAL_START (__physical_start) #define PHYSICAL_END (__physical_end) +void setup(const void *fdt); + #endif /* _ASMPOWERPC_SETUP_H_ */ diff --git a/lib/powerpc/hcall.c b/lib/powerpc/hcall.c index 7b05265..711cb1b 100644 --- a/lib/powerpc/hcall.c +++ b/lib/powerpc/hcall.c @@ -9,6 +9,8 @@ * This work is licensed under the terms of the GNU LGPL, version 2. */ #include +#include +#include "io.h" int hcall_have_broken_sc1(void) { diff --git a/lib/powerpc/io.c b/lib/powerpc/io.c index 6a94bcc..915e12e 100644 --- a/lib/powerpc/io.c +++ b/lib/powerpc/io.c @@ -8,9 +8,10 @@ #include #include #include +#include +#include "io.h" extern void halt(int code); -extern void putchar(int c); static struct spinlock print_lock; diff --git a/lib/powerpc/io.h b/lib/powerpc/io.h new file mode 100644 index 0000000..1f5a7bd --- /dev/null +++ b/lib/powerpc/io.h @@ -0,0 +1,8 @@ +/* + * Prototypes for io.c + * + * This work is licensed under the terms of the GNU GPL, version 2. + */ + +extern void io_init(void); +extern void putchar(int c); diff --git a/lib/powerpc/setup.c b/lib/powerpc/setup.c index d8f4327..1be4c03 100644 --- a/lib/powerpc/setup.c +++ b/lib/powerpc/setup.c @@ -19,9 +19,9 @@ #include #include #include +#include "io.h" extern unsigned long stacktop; -extern void io_init(void); char *initrd; u32 initrd_size; diff --git a/powerpc/reloc64.c b/powerpc/reloc64.c index d919372..f6aaabe 100644 --- a/powerpc/reloc64.c +++ b/powerpc/reloc64.c @@ -24,6 +24,8 @@ struct elf64_rela { signed long long addend; }; +void relocate(unsigned long load_addr, struct elf64_dyn *dyn_table); + void relocate(unsigned long load_addr, struct elf64_dyn *dyn_table) { unsigned long long rela_addr = 0, rela_count = 0, *addr;