This patch takes all the version code checks that were made against a
constant (either decimal or hex) and changes them to using the
KERNEL_VERSION macro. This uncovered a nice "feature" in GCC that when
a macro with no args is undefined and used in a #if comparison, GCC
silently sets its value to zero. This means that some places
(udf_fs_sb.h for example) that were missing a #include <linux/version.h>
were possibly miscompiling.
On another note, the KERNEL_VERSION macro was introduced in 2.1.90. If
driver maintainers wish to actively support kernels older than this then
they should add to their code:
#ifndef KERNEL_VERSION
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
#endif
My next patch will cover the cases that use a redundant macro (ie,
LinuxVersionCode).
Please test this patch a bit before I send it to Linus.
http://quark.vpplus.com/~bgerst/linux/diff-2.3.30-pre3a.gz
--Brian Gerst
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/