2012-10-15 16:21:25

by Larry Finger

[permalink] [raw]
Subject: Problem with KERNEL_VERSION macros in 3.7-rc1?

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