All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>, qemu-devel@nongnu.org
Cc: Laszlo Ersek <lersek@redhat.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	qemu-trivial@nongnu.org
Subject: [Qemu-devel] [PATCH] hw/nvram/fw_cfg: Move boot_splash_filedata variables into fw_cfg.c
Date: Mon, 25 Feb 2019 17:14:58 +0100	[thread overview]
Message-ID: <1551111298-8445-1-git-send-email-thuth@redhat.com> (raw)

The global boot_splash_filedata and boot_splash_filedata_size variables
are only used in fw_cfg.c. So there is really no need that these need
to be global and reside in vl.c. Move them to fw_cfg.c instead.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/nvram/fw_cfg.c         |  9 +++++++++
 include/hw/nvram/fw_cfg.h |  1 +
 include/sysemu/sysemu.h   |  2 --
 vl.c                      | 10 +---------
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 7fdf04a..15f0023 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -63,6 +63,9 @@ struct FWCfgEntry {
 #define JPG_FILE 0
 #define BMP_FILE 1
 
+static uint8_t *boot_splash_filedata;
+static size_t boot_splash_filedata_size;
+
 static char *read_splashfile(char *filename, gsize *file_sizep,
                              int *file_typep)
 {
@@ -175,6 +178,12 @@ static void fw_cfg_bootsplash(FWCfgState *s)
     }
 }
 
+void fw_cfg_res_free(void)
+{
+    g_free(boot_splash_filedata);
+    boot_splash_filedata = NULL;
+}
+
 static void fw_cfg_reboot(FWCfgState *s)
 {
     const char *reboot_timeout = NULL;
diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h
index f5a6895..16d237c 100644
--- a/include/hw/nvram/fw_cfg.h
+++ b/include/hw/nvram/fw_cfg.h
@@ -225,5 +225,6 @@ FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
 
 FWCfgState *fw_cfg_find(void);
 bool fw_cfg_dma_enabled(void *opaque);
+void fw_cfg_res_free(void);
 
 #endif
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 4b5a6b7..63a5eed 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -111,8 +111,6 @@ extern int no_shutdown;
 extern int old_param;
 extern int boot_menu;
 extern bool boot_strict;
-extern uint8_t *boot_splash_filedata;
-extern size_t boot_splash_filedata_size;
 extern bool enable_mlock;
 extern bool enable_cpu_pm;
 extern QEMUClockType rtc_clock;
diff --git a/vl.c b/vl.c
index 502857a..f769cce 100644
--- a/vl.c
+++ b/vl.c
@@ -187,8 +187,6 @@ unsigned int nb_prom_envs = 0;
 const char *prom_envs[MAX_PROM_ENVS];
 int boot_menu;
 bool boot_strict;
-uint8_t *boot_splash_filedata;
-size_t boot_splash_filedata_size;
 bool wakeup_suspend_enabled;
 
 int icount_align_option;
@@ -559,12 +557,6 @@ const char *qemu_get_vm_name(void)
     return qemu_name;
 }
 
-static void res_free(void)
-{
-    g_free(boot_splash_filedata);
-    boot_splash_filedata = NULL;
-}
-
 static int default_driver_check(void *opaque, QemuOpts *opts, Error **errp)
 {
     const char *driver = qemu_opt_get(opts, "driver");
@@ -4585,7 +4577,7 @@ int main(int argc, char **argv, char **envp)
     job_cancel_sync_all();
     bdrv_close_all();
 
-    res_free();
+    fw_cfg_res_free();
 
     /* vhost-user must be cleaned up before chardevs.  */
     tpm_cleanup();
-- 
1.8.3.1

             reply	other threads:[~2019-02-25 16:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-25 16:14 Thomas Huth [this message]
2019-02-25 18:31 ` [Qemu-devel] [PATCH] hw/nvram/fw_cfg: Move boot_splash_filedata variables into fw_cfg.c Laszlo Ersek
2019-03-01 11:28   ` Thomas Huth
2019-03-01 12:32     ` Philippe Mathieu-Daudé
2019-03-01 12:39       ` Thomas Huth

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=1551111298-8445-1-git-send-email-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=lersek@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.