qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Cameron Esfahani" <dirty@apple.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	haxm-team@intel.com, "Roman Bolshakov" <r.bolshakov@yadro.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Wenchao Wang" <wenchao.wang@intel.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Stefan Weil" <sw@weilnetz.de>,
	"Peter Maydell" <peter.maydell@linaro.org>
Subject: [PATCH 5/5] hw/i386/x86: Reduce init_topo_info() scope
Date: Fri, 16 Dec 2022 23:01:58 +0100	[thread overview]
Message-ID: <20221216220158.6317-6-philmd@linaro.org> (raw)
In-Reply-To: <20221216220158.6317-1-philmd@linaro.org>

This function is not used anywhere outside this file, so
we can delete the prototype from include/hw/i386/x86.h and
make the function "static void".

This fixes when building with -Wall and using Clang
("Apple clang version 14.0.0 (clang-1400.0.29.202)"):

  ../hw/i386/x86.c:70:24: error: static function 'MACHINE' is used in an inline function with external linkage [-Werror,-Wstatic-in-inline]
      MachineState *ms = MACHINE(x86ms);
                         ^
  include/hw/i386/x86.h:101:1: note: use 'static' to give inline function 'init_topo_info' internal linkage
  void init_topo_info(X86CPUTopoInfo *topo_info, const X86MachineState *x86ms);
  ^
  static
  include/hw/boards.h:24:49: note: 'MACHINE' declared here
  OBJECT_DECLARE_TYPE(MachineState, MachineClass, MACHINE)
                                                  ^

Reported-by: Stefan Weil <sw@weilnetz.de>
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/i386/x86.c         | 2 +-
 include/hw/i386/x86.h | 3 ---
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/hw/i386/x86.c b/hw/i386/x86.c
index 78cc131926..b6ba0b2d00 100644
--- a/hw/i386/x86.c
+++ b/hw/i386/x86.c
@@ -64,7 +64,7 @@
 /* Physical Address of PVH entry point read from kernel ELF NOTE */
 static size_t pvh_start_addr;
 
-inline void init_topo_info(X86CPUTopoInfo *topo_info,
+static void init_topo_info(X86CPUTopoInfo *topo_info,
                            const X86MachineState *x86ms)
 {
     MachineState *ms = MACHINE(x86ms);
diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h
index 62fa5774f8..5d3047a1d1 100644
--- a/include/hw/i386/x86.h
+++ b/include/hw/i386/x86.h
@@ -20,7 +20,6 @@
 #include "exec/hwaddr.h"
 #include "qemu/notify.h"
 
-#include "hw/i386/topology.h"
 #include "hw/boards.h"
 #include "hw/nmi.h"
 #include "hw/isa/isa.h"
@@ -98,8 +97,6 @@ struct X86MachineState {
 #define TYPE_X86_MACHINE   MACHINE_TYPE_NAME("x86")
 OBJECT_DECLARE_TYPE(X86MachineState, X86MachineClass, X86_MACHINE)
 
-void init_topo_info(X86CPUTopoInfo *topo_info, const X86MachineState *x86ms);
-
 uint32_t x86_cpu_apic_id_from_index(X86MachineState *pcms,
                                     unsigned int cpu_index);
 
-- 
2.38.1



  parent reply	other threads:[~2022-12-16 22:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-16 22:01 [PATCH 0/5] target/i386: Header cleanups around "cpu.h" Philippe Mathieu-Daudé
2022-12-16 22:01 ` [PATCH 1/5] target/i386: Remove NEED_CPU_H guard from target-specific headers Philippe Mathieu-Daudé
2022-12-17  0:21   ` Richard Henderson
2022-12-16 22:01 ` [PATCH 2/5] target/i386/cpu: Remove dead helper_lock() declaration Philippe Mathieu-Daudé
2022-12-17  0:21   ` Richard Henderson
2022-12-16 22:01 ` [PATCH 3/5] target/i386/ops_sse: Include missing "cpu.h" header Philippe Mathieu-Daudé
2022-12-17  0:23   ` Richard Henderson
2022-12-16 22:01 ` [PATCH 4/5] target/i386: Remove x86_cpu_dump_local_apic_state() dead stub Philippe Mathieu-Daudé
2022-12-17  0:24   ` Richard Henderson
2022-12-16 22:01 ` Philippe Mathieu-Daudé [this message]
2022-12-17  0:25   ` [PATCH 5/5] hw/i386/x86: Reduce init_topo_info() scope Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221216220158.6317-6-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=dirty@apple.com \
    --cc=eduardo@habkost.net \
    --cc=haxm-team@intel.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=r.bolshakov@yadro.com \
    --cc=richard.henderson@linaro.org \
    --cc=sw@weilnetz.de \
    --cc=wenchao.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).