Problem with KERNEL_VERSION macros in 3.7-rc1?

From: Larry Finger
Date: Mon Oct 15 2012 - 12:21:14 EST


The VirtualBox kernel modules need to be modified to account for the removal of VM_RESERVED in version 3.7-rc1. When I used the normal test of LINUX_VERSION_CODE against KERNEL_VERSION(3, 7, 0), the fix did not work. To test why, I added the following code snippet to a module:

#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0)
#warning "Compiling 3.7.0"
#else
#warning "Compiling older kernel"
#endif

When compiling this code, I get 'warning: #warning "Compiling older kernel" [-Wcpp]' on the console. The command 'uname -r' echoes "3.7.0-rc1", and 'git describe' returns "v3.7-rc1".

My workaround is to define VM_RESERVED if it is not defined.

Thanks,

Larry




--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/