standard for kernel version calculation?

Bernhard Fischer rep.nop at aon.at
Thu Mar 30 11:28:05 UTC 2006


On Thu, Mar 30, 2006 at 06:19:05AM -0500, Robert P. J. Day wrote:
>On Wed, 29 Mar 2006, Rob Landley wrote:
>
>> On Wednesday 29 March 2006 2:55 pm, Robert P. J. Day wrote:
>> >   um ... would someone like to suggest a single standard for
>> > kernel version comparison?  the (abridged) result of a recursive
>> > grep:
>> >
>> > 	if (get_kernel_revision() <= 2*65536+6*256)
>> > 	if (get_kernel_revision() < KRELEASE(2, 1, 0))
>> > 	if (get_kernel_revision() < MAKE_VERSION(2, 1, 117))
>> >         if (get_kernel_revision() <= 66314
>> >
>> > i'm thinking that perhaps just one of these variations would be
>> > sufficient. :-)
>>
>> It would be nice if anything that actually needed to care could be
>> moved to platform.h or platform.c somehow, but I doubt it's likely
>> in the short term...
>
>sure, but in the short term, we can at least standardize on the
>comparison.  the kernel source uses the macro:
>
>#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
>
>
>any reason not to add that definition to something like platform.h or
>libbb.h and change all those tests to use that?

Fine with me. Care to put it into platform.h and send a patch?



More information about the busybox mailing list