diff mbox series

[v2,kvmtool,02/30] hw/i8042: Compile only for x86

Message ID 20200123134805.1993-3-alexandru.elisei@arm.com (mailing list archive)
State New, archived
Headers show
Series Add reassignable BARs and PCIE 1.1 support | expand

Commit Message

Alexandru Elisei Jan. 23, 2020, 1:47 p.m. UTC
The initialization function for the i8042 emulated device does exactly
nothing for all architectures, except for x86. As a result, the device
is usable only for x86, so let's make the file an architecture specific
object file.

Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
---
 Makefile   | 2 +-
 hw/i8042.c | 4 ----
 2 files changed, 1 insertion(+), 5 deletions(-)

Comments

Andre Przywara Jan. 27, 2020, 6:07 p.m. UTC | #1
On Thu, 23 Jan 2020 13:47:37 +0000
Alexandru Elisei <alexandru.elisei@arm.com> wrote:

> The initialization function for the i8042 emulated device does exactly
> nothing for all architectures, except for x86. As a result, the device
> is usable only for x86, so let's make the file an architecture specific
> object file.
> 
> Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>

Reviewed-by: Andre Przywara <andre.przywara@arm.com>

Cheers,
Andre.

> ---
>  Makefile   | 2 +-
>  hw/i8042.c | 4 ----
>  2 files changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 6d6880dd4f8a..33eddcbb4d66 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -103,7 +103,6 @@ OBJS	+= hw/pci-shmem.o
>  OBJS	+= kvm-ipc.o
>  OBJS	+= builtin-sandbox.o
>  OBJS	+= virtio/mmio.o
> -OBJS	+= hw/i8042.o
>  
>  # Translate uname -m into ARCH string
>  ARCH ?= $(shell uname -m | sed -e s/i.86/i386/ -e s/ppc.*/powerpc/ \
> @@ -124,6 +123,7 @@ endif
>  #x86
>  ifeq ($(ARCH),x86)
>  	DEFINES += -DCONFIG_X86
> +	OBJS	+= hw/i8042.o
>  	OBJS	+= x86/boot.o
>  	OBJS	+= x86/cpuid.o
>  	OBJS	+= x86/interrupt.o
> diff --git a/hw/i8042.c b/hw/i8042.c
> index 288b7d1108ac..2d8c96e9c7e6 100644
> --- a/hw/i8042.c
> +++ b/hw/i8042.c
> @@ -349,10 +349,6 @@ static struct ioport_operations kbd_ops = {
>  
>  int kbd__init(struct kvm *kvm)
>  {
> -#ifndef CONFIG_X86
> -	return 0;
> -#endif
> -
>  	kbd_reset();
>  	state.kvm = kvm;
>  	ioport__register(kvm, I8042_DATA_REG, &kbd_ops, 2, NULL);
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 6d6880dd4f8a..33eddcbb4d66 100644
--- a/Makefile
+++ b/Makefile
@@ -103,7 +103,6 @@  OBJS	+= hw/pci-shmem.o
 OBJS	+= kvm-ipc.o
 OBJS	+= builtin-sandbox.o
 OBJS	+= virtio/mmio.o
-OBJS	+= hw/i8042.o
 
 # Translate uname -m into ARCH string
 ARCH ?= $(shell uname -m | sed -e s/i.86/i386/ -e s/ppc.*/powerpc/ \
@@ -124,6 +123,7 @@  endif
 #x86
 ifeq ($(ARCH),x86)
 	DEFINES += -DCONFIG_X86
+	OBJS	+= hw/i8042.o
 	OBJS	+= x86/boot.o
 	OBJS	+= x86/cpuid.o
 	OBJS	+= x86/interrupt.o
diff --git a/hw/i8042.c b/hw/i8042.c
index 288b7d1108ac..2d8c96e9c7e6 100644
--- a/hw/i8042.c
+++ b/hw/i8042.c
@@ -349,10 +349,6 @@  static struct ioport_operations kbd_ops = {
 
 int kbd__init(struct kvm *kvm)
 {
-#ifndef CONFIG_X86
-	return 0;
-#endif
-
 	kbd_reset();
 	state.kvm = kvm;
 	ioport__register(kvm, I8042_DATA_REG, &kbd_ops, 2, NULL);