[PATCH 1/2] IB/qib: don't use qib_wc_x86_64 for UML

From: Randy Dunlap
Date: Sun Jan 02 2022 - 02:06:18 EST


When building qib_wc_x86_64.c on ARCH=um, references to some cpuinfo
fields cause build errors since cpuinfo does not contain x86-specific
fields.

This source file is x86_64-specific, so don't include it in the
target object file when CONFIG_UML is set/enabled.

Prevents these build errors:

../drivers/infiniband/hw/qib/qib_wc_x86_64.c: In function ‘qib_unordered_wc’:
../drivers/infiniband/hw/qib/qib_wc_x86_64.c:149:22: error: ‘struct cpuinfo_um’ has no member named ‘x86_vendor’
return boot_cpu_data.x86_vendor != X86_VENDOR_AMD;
^
../drivers/infiniband/hw/qib/qib_wc_x86_64.c:149:37: error: ‘X86_VENDOR_AMD’ undeclared (first use in this function); did you mean ‘X86_VENDOR_ANY’?
return boot_cpu_data.x86_vendor != X86_VENDOR_AMD;
^~~~~~~~~~~~~~
../drivers/infiniband/hw/qib/qib_wc_x86_64.c:150:1: error: control reaches end of non-void function [-Werror=return-type]

Fixes: 68f5d3f3b654 ("um: add PCI over virtio emulation driver")
Signed-off-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
---
drivers/infiniband/hw/qib/Makefile | 2 ++
1 file changed, 2 insertions(+)

--- linux-next-20211224.orig/drivers/infiniband/hw/qib/Makefile
+++ linux-next-20211224/drivers/infiniband/hw/qib/Makefile
@@ -12,6 +12,8 @@ ib_qib-y := qib_diag.o qib_driver.o qib_
# 6120 has no fallback if no MSI interrupts, others can do INTx
ib_qib-$(CONFIG_PCI_MSI) += qib_iba6120.o

+ifeq ($(CONFIG_UML),)
ib_qib-$(CONFIG_X86_64) += qib_wc_x86_64.o
+endif
ib_qib-$(CONFIG_PPC64) += qib_wc_ppc64.o
ib_qib-$(CONFIG_DEBUG_FS) += qib_debugfs.o