From patchwork Mon Jun 11 11:41:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 927625 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=kvm-ppc-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 414B1l4ydjz9s2t for ; Mon, 11 Jun 2018 21:41:47 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932966AbeFKLlp (ORCPT ); Mon, 11 Jun 2018 07:41:45 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40494 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932858AbeFKLln (ORCPT ); Mon, 11 Jun 2018 07:41:43 -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 6DAA77C6C4; Mon, 11 Jun 2018 11:41:42 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-207.ams2.redhat.com [10.36.116.207]) by smtp.corp.redhat.com (Postfix) with ESMTP id 303582024CB3; Mon, 11 Jun 2018 11:41:40 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org Cc: kvm-ppc@vger.kernel.org, Laurent Vivier , =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= Subject: [kvm-unit-tests PATCH] powerpc: Make code compilable with -Wmissing-prototypes Date: Mon, 11 Jun 2018 13:41:40 +0200 Message-Id: <1528717300-27112-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.2]); Mon, 11 Jun 2018 11:41:42 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 11 Jun 2018 11:41:42 +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-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org 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) Signed-off-by: Thomas Huth Reviewed-by: Laurent Vivier --- 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;