Commit df2e400e authored by Janosch Frank's avatar Janosch Frank Committed by Heiko Carstens

s390/uv: fix prot virt host indication compilation

prot_virt_host is only available if CONFIG_KVM is enabled. So lets use
a variable initialized to zero and overwrite it when that config
option is set with prot_virt_host.
Signed-off-by: default avatarJanosch Frank <frankja@linux.ibm.com>
Fixes: 37564ed8 ("s390/uv: add prot virt guest/host indication files")
Reported-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent 5671d971
...@@ -420,7 +420,13 @@ static ssize_t uv_is_prot_virt_guest(struct kobject *kobj, ...@@ -420,7 +420,13 @@ static ssize_t uv_is_prot_virt_guest(struct kobject *kobj,
static ssize_t uv_is_prot_virt_host(struct kobject *kobj, static ssize_t uv_is_prot_virt_host(struct kobject *kobj,
struct kobj_attribute *attr, char *page) struct kobj_attribute *attr, char *page)
{ {
return scnprintf(page, PAGE_SIZE, "%d\n", prot_virt_host); int val = 0;
#if IS_ENABLED(CONFIG_KVM)
val = prot_virt_host;
#endif
return scnprintf(page, PAGE_SIZE, "%d\n", val);
} }
static struct kobj_attribute uv_prot_virt_guest = static struct kobj_attribute uv_prot_virt_guest =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment