ve_hook_register is a no-op when !CONFIG_VE, but it still
needs &cn_ss_hook to be a valid expression.

struct ve_hook is not defined when !CONFIG_VE, so create a dummy
variable cn_ss_hook in such case just to make compiler happy.

https://virtuozzo.atlassian.net/browse/VSTOR-130116

Feature: !CONFIG_VE build
Signed-off-by: Vladimir Riabchun <[email protected]>
---
 drivers/connector/connector.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c
index 47f7fb284540..39a697803d0f 100644
--- a/drivers/connector/connector.c
+++ b/drivers/connector/connector.c
@@ -383,12 +383,17 @@ static void cn_fini_ve(void *data)
        ve->cn = NULL;
 }
 
+#ifdef CONFIG_VE
 static struct ve_hook cn_ss_hook = {
        .init = cn_init_ve,
        .fini = cn_fini_ve,
        .priority = HOOK_PRIO_DEFAULT,
        .owner = THIS_MODULE,
 };
+#else
+/* When !CONFIG_VE ve_hook_register is a no-op */
+static int __maybe_unused cn_ss_hook;
+#endif
 
 static int cn_init(void)
 {
-- 
2.47.1

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to