Skip to contentSkip to conversation

Only expose compat ioctl when CONFIG_COMPAT

PATCH Applied Alexander Graf 2 participants 2 messages Oct 23, 2009 1 message not in the archive KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Only expose compat ioctl when CONFIG_COMPAT

Jan spotted that we shouldn't use a function only available when CONFIG_COMPAT in a struct that's available without the config option.

So since my patch introduces that, let's just not export the compat ioctl function when CONFIG_COMPAT is not set, so we don't break then.

---
 virt/kvm/kvm_main.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
virt/kvm/kvm_main.c +2 -0
index 54a272f..bd44fb4 100644
@@ -1623,7 +1623,9 @@ static int kvm_vm_mmap(struct file *file, struct vm_area_struct *vma)
 static struct file_operations kvm_vm_fops = {
 	.release        = kvm_vm_release,
 	.unlocked_ioctl = kvm_vm_ioctl,
+#ifdef CONFIG_COMPAT
 	.compat_ioctl   = kvm_vm_compat_ioctl,
+#endif
 	.mmap           = kvm_vm_mmap,
 };
 
Signature · 1 line
1.6.0.2

A message that is not in the archive (sent off-list or not yet received): 1256290914-18169-1-git-send-email-agraf-l3A5Bk7waGM@public.gmane.org

#2 lore raw
Quoted 8 lines · Alexander Graf

Jan spotted that we shouldn't use a function only available when CONFIG_COMPAT in a struct that's available without the config option.

So since my patch introduces that, let's just not export the compat ioctl function when CONFIG_COMPAT is not set, so we don't break then.

Applied, thanks.