Compute linux version code

Linux version.h: LINUX_VERSION_CODE is X*65536 + Y*256 + Z

e.g. Linux 2.6.31.8:
LINUX_VERSION_CODE = 2*65536 + 6*256 + 31 = 132639

root@nsa310:~# cat /ffp/include/linux/version.h
#define LINUX_VERSION_CODE 132639
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.