Trivial cleanup in hw/acpi
v4 cover Trivial cleanup in hw/acpi
There are several functions/variable which are not used anymore.
This serials just remove those without functional change.
v4: fix reviewed-by tags
v3: add ack and repost in a new thread
v2: change commit log from "is now used in no place" to "in not used anymore"
Wei Yang (3):
hw/i386/pc.c: remove unused function pc_acpi_init() hw/acpi: remove unused function acpi_table_add_builtin() hw/acpi: remove unnecessary variable acpi_table_builtin
hw/acpi/core.c | 10 +--------- hw/i386/pc.c | 27 --------------------------- include/hw/acpi/acpi.h | 1 - include/hw/i386/pc.h | 1 - 4 files changed, 1 insertion(+), 38 deletions(-)
Signature · 1 line
2.19.1
PATCH v4 1/3 hw/i386/pc.c: remove unused function pc_acpi_init()
Function pc_acpi_init() is not used anymore.
Remove the definition and declaration.
--- hw/i386/pc.c | 27 --------------------------- include/hw/i386/pc.h | 1 - 2 files changed, 28 deletions(-)
hw/i386/pc.c +0 -27
@@ -1280,33 +1280,6 @@ void pc_pci_as_mapping_init(Object *owner, MemoryRegion *system_memory, pci_address_space, -1); } -void pc_acpi_init (const char *default_dsdt) -{ -char *filename; - -if (acpi_tables !=NULL ) { -/* manually set via -acpitable, leave it alone */ -return ; - } - - filename =qemu_find_file (QEMU_FILE_TYPE_BIOS , default_dsdt); -if (filename ==NULL ) { -warn_report ("failed to find %s" , default_dsdt); - }else { -QemuOpts *opts =qemu_opts_create (qemu_find_opts ("acpi" ),NULL ,0 , - &error_abort); -Error *err =NULL ; - -qemu_opt_set (opts,"file" , filename, &error_abort); - -acpi_table_add_builtin (opts, &err); -if (err) { -warn_reportf_err (err,"failed to load %s: " , filename); - } -g_free (filename); - } -} -void xen_load_linux (PCMachineState *pcms) {int i;
include/hw/i386/pc.h +0 -1
@@ -187,7 +187,6 @@ void pc_acpi_smi_interrupt(void *opaque, int irq, int level);void pc_cpus_init (PCMachineState *pcms);void pc_hot_add_cpu (const int64_t id,Error **errp); -void pc_acpi_init (const char *default_dsdt);void pc_guest_info_init (PCMachineState *pcms);
Signature · 1 line
2.19.1
Laurent Vivier
AppliedRe: [Qemu-devel] [Qemu-trivial] [Patch v4 1/3] hw/i386/pc.c: remove unused function pc_acpi_init()
Quoted 58 lines · Wei Yang
Function
pc_acpi_init()is not used anymore.Remove the definition and declaration.
Signed-off-by Wei Yang <[email protected]>Reviewed-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Igor Mammedov <[email protected]>Reviewed-by Thomas Huth <[email protected]>--- hw/i386/pc.c | 27 --------------------------- include/hw/i386/pc.h | 1 - 2 files changed, 28 deletions(-)hw/i386/pc.c +0
-27@@ -1280,33 +1280,6 @@ void pc_pci_as_mapping_init(Object *owner, MemoryRegion *system_memory, pci_address_space, -1); } -void pc_acpi_init (const char *default_dsdt) -{ -char *filename; - -if (acpi_tables !=NULL ) { -/* manually set via -acpitable, leave it alone */ -return ; - } - - filename =qemu_find_file (QEMU_FILE_TYPE_BIOS , default_dsdt); -if (filename ==NULL ) { -warn_report ("failed to find %s" , default_dsdt); - }else { -QemuOpts *opts =qemu_opts_create (qemu_find_opts ("acpi" ),NULL ,0 , - &error_abort); -Error *err =NULL ; - -qemu_opt_set (opts,"file" , filename, &error_abort); - -acpi_table_add_builtin (opts, &err); -if (err) { -warn_reportf_err (err,"failed to load %s: " , filename); - } -g_free (filename); - } -} -void xen_load_linux (PCMachineState *pcms) {int i;include/hw/i386/pc.h +0
-0
include/hw/i386/pc.h void pc_acpi_smi_interrupt(void *opaque, int irq, int level); · line 192
Quoted 7 lines
include/hw/i386/pc.h +0
-1@@ -187,7 +187,6 @@ void pc_acpi_smi_interrupt(void *opaque, int irq, int level);void pc_cpus_init (PCMachineState *pcms);void pc_hot_add_cpu (const int64_t id,Error **errp); -void pc_acpi_init (const char *default_dsdt);void pc_guest_info_init (PCMachineState *pcms);
Applied to my trivial-patches branch.
Thanks,
Laurent
PATCH v4 2/3 hw/acpi: remove unused function acpi_table_add_builtin()
In reply to Wei YangFunction acpi_table_add_builtin() is not used anymore.
Remove the definition and declaration.
--- hw/acpi/core.c | 6 ------ include/hw/acpi/acpi.h | 1 - 2 files changed, 7 deletions(-)
hw/acpi/core.c +0 -6
@@ -305,12 +305,6 @@ out:static bool acpi_table_builtin = false; -void acpi_table_add_builtin (const QemuOpts *opts,Error **errp) -{ - acpi_table_builtin = true; -acpi_table_add (opts, errp); -} -unsigned acpi_table_len (void *current) {struct acpi_table_header *hdr = current -sizeof (hdr->_length);
include/hw/acpi/acpi.h +0 -1
@@ -190,7 +190,6 @@ uint8_t *acpi_table_first(void);uint8_t *acpi_table_next (uint8_t *current);unsigned acpi_table_len (void *current);void acpi_table_add (const QemuOpts *opts,Error **errp); -void acpi_table_add_builtin (const QemuOpts *opts,Error **errp);typedef struct AcpiSlicOem AcpiSlicOem ;struct AcpiSlicOem {
Signature · 1 line
2.19.1
Laurent Vivier
AppliedRe: [Qemu-devel] [Qemu-trivial] [Patch v4 2/3] hw/acpi: remove unused function acpi_table_add_builtin()
Quoted 36 lines · Wei Yang
Function
acpi_table_add_builtin()is not used anymore.Remove the definition and declaration.
Signed-off-by Wei Yang <[email protected]>Reviewed-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Igor Mammedov <[email protected]>--- hw/acpi/core.c | 6 ------ include/hw/acpi/acpi.h | 1 - 2 files changed, 7 deletions(-)hw/acpi/core.c +0
-6@@ -305,12 +305,6 @@ out:static bool acpi_table_builtin = false; -void acpi_table_add_builtin (const QemuOpts *opts,Error **errp) -{ - acpi_table_builtin = true; -acpi_table_add (opts, errp); -} -unsigned acpi_table_len (void *current) {struct acpi_table_header *hdr = current -sizeof (hdr->_length);include/hw/acpi/acpi.h +0
-0
include/hw/acpi/acpi.h uint8_t *acpi_table_first(void); · line 195
Quoted 7 lines
include/hw/acpi/acpi.h +0
-1@@ -190,7 +190,6 @@ uint8_t *acpi_table_first(void);uint8_t *acpi_table_next (uint8_t *current);unsigned acpi_table_len (void *current);void acpi_table_add (const QemuOpts *opts,Error **errp); -void acpi_table_add_builtin (const QemuOpts *opts,Error **errp);typedef struct AcpiSlicOem AcpiSlicOem ;struct AcpiSlicOem {
Applied to my trivial-patches branch.
Thanks,
Laurent
PATCH v4 3/3 hw/acpi: remove unnecessary variable acpi_table_builtin
In reply to Wei Yangacpi_table_builtin is now always false, it is not necessary to check it again.
This patch just removes it.
--- hw/acpi/core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
hw/acpi/core.c +1 -3
@@ -303,8 +303,6 @@ out:error_propagate (errp, err); } -static bool acpi_table_builtin = false; -unsigned acpi_table_len (void *current) {struct acpi_table_header *hdr = current -sizeof (hdr->_length);
@@ -320,7 +318,7 @@ void *acpi_table_hdr(void *h)uint8_t *acpi_table_first (void ) { -if (acpi_table_builtin || !acpi_tables) { +if (!acpi_tables) {return NULL ; }return acpi_table_hdr (acpi_tables +ACPI_TABLE_PFX_SIZE );
Signature · 1 line
2.19.1
Laurent Vivier
AppliedRe: [Qemu-devel] [Qemu-trivial] [Patch v4 3/3] hw/acpi: remove unnecessary variable acpi_table_builtin
Quoted 28 lines · Wei Yang
acpi_table_builtinis now always false, it is not necessary to check it again.This patch just removes it.
Signed-off-by Wei Yang <[email protected]>Reviewed-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Igor Mammedov <[email protected]>--- hw/acpi/core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)hw/acpi/core.c +0
-2@@ -303,8 +303,6 @@ out:error_propagate (errp, err); } -static bool acpi_table_builtin = false; -unsigned acpi_table_len (void *current) {struct acpi_table_header *hdr = current -sizeof (hdr->_length);
hw/acpi/core.c void *acpi_table_hdr(void *h) · line 324
Quoted 8 lines
hw/acpi/core.c +1
-1@@ -320,7 +318,7 @@ void *acpi_table_hdr(void *h)uint8_t *acpi_table_first (void ) { -if (acpi_table_builtin || !acpi_tables) { +if (!acpi_tables) {return NULL ; }return acpi_table_hdr (acpi_tables +ACPI_TABLE_PFX_SIZE );
Applied to my trivial-patches branch.
Thanks,
Laurent