linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] virt: acrn: Fix vCPU removing code build error
@ 2021-02-12  4:57 shuo.a.liu
  2021-02-12  7:52 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 5+ messages in thread
From: shuo.a.liu @ 2021-02-12  4:57 UTC (permalink / raw)
  To: linux-next
  Cc: Stephen Rothwell, Randy Dunlap, Greg Kroah-Hartman, linux-kernel,
	Shuo Liu

From: Shuo Liu <shuo.a.liu@intel.com>

vCPU removing code depends on CONFIG_HOTPLUG_CPU as it uses remove_cpu()
and add_cpu(). Make the vCPU removing interface building with
CONFIG_HOTPLUG_CPU.

../drivers/virt/acrn/hsm.c: In function ‘remove_cpu_store’:
../drivers/virt/acrn/hsm.c:389:3: error: implicit declaration of function ‘remove_cpu’; [-Werror=implicit-function-declaration]
   remove_cpu(cpu);

../drivers/virt/acrn/hsm.c:402:2: error: implicit declaration of function ‘add_cpu’; [-Werror=implicit-function-declaration]
   add_cpu(cpu);

Fixes: 279dcf693ac7 ("virt: acrn: Introduce an interface for Service VM to control vCPU")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Signed-off-by: Shuo Liu <shuo.a.liu@intel.com>
---
 drivers/virt/acrn/hsm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/virt/acrn/hsm.c b/drivers/virt/acrn/hsm.c
index 1f6b7c54a1a4..e340788aacdf 100644
--- a/drivers/virt/acrn/hsm.c
+++ b/drivers/virt/acrn/hsm.c
@@ -372,6 +372,7 @@ static int acrn_dev_release(struct inode *inode, struct file *filp)
 	return 0;
 }
 
+#ifdef CONFIG_HOTPLUG_CPU
 static ssize_t remove_cpu_store(struct device *dev,
 				struct device_attribute *attr,
 				const char *buf, size_t count)
@@ -403,9 +404,12 @@ static ssize_t remove_cpu_store(struct device *dev,
 	return ret;
 }
 static DEVICE_ATTR_WO(remove_cpu);
+#endif
 
 static struct attribute *acrn_attrs[] = {
+#ifdef CONFIG_HOTPLUG_CPU
 	&dev_attr_remove_cpu.attr,
+#endif
 	NULL
 };
 

base-commit: 671176b0016c80b3943cb5387312c886aba3308d
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-02-12 11:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-12  4:57 [PATCH] virt: acrn: Fix vCPU removing code build error shuo.a.liu
2021-02-12  7:52 ` Greg Kroah-Hartman
2021-02-12 10:58   ` Shuo A Liu
2021-02-12 11:02     ` Greg Kroah-Hartman
2021-02-12 11:19       ` Shuo A Liu

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).