I am trying to fix a driver that references d_alias or d_u.d_alias in kernel 3.16.0-69. The macro looks for the kernel versions and uses the appropriate one.
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) || LINUX_VERSION_CODE == KERNEL_VERSION(3,12,49) || LINUX_VERSION_CODE == KERNEL_VERSION(3,16,67)
//946e51f2bf37f1656916eb75bd0742ba33983c28, move d_rcu from overlapping d_child to overlapping d_alias;
//SLES 12.1 (3.12.49) back port it too
dentry = hlist_entry(p, struct dentry, d_u.d_alias);
#else
dentry = hlist_entry(p, struct dentry, d_alias);
#endif
The problem i am having is that if I use KERNEL_VERSION(3,16,0) it works for 3.16.0-69 but breaks for 3.16.0-30. How can i reference the bugfix part of the kernel, the 69 or 30 in this example. I have tried this and it does not work.
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0-31) || LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) || LINUX_VERSION_CODE == KERNEL_VERSION(3,12,49) || LINUX_VERSION_CODE == KERNEL_VERSION(3,16,67)
I am trying to fix this properly as I have to maintain this until the vendor fixes it.