kversion

Macro kversion 

Source
macro_rules! kversion {
    (>  $($rest:tt)+) => { ... };
    (<  $($rest:tt)+) => { ... };
    (== $($rest:tt)+) => { ... };
    (>= $($rest:tt)+) => { ... };
    (<= $($rest:tt)+) => { ... };
    ($major:expr) => { ... };
    ($major:expr, $minor:expr) => { ... };
    ($major:expr, $minor:expr, $revision:expr) => { ... };
}
Available on ((Linux or Android) and (x86-64 and little-endian and 64-bit, or AArch64 and 64-bit, or ARM and 32-bit, or x86 and little-endian and 32-bit), or Linux and (x86-64 and little-endian and 32-bit, or RISC-V RV64 and little-endian and 64-bit, or RISC-V RV32 and little-endian and 32-bit, or MIPS and 32-bit, or MIPS-64 and 64-bit, or s390x and big-endian and 64-bit, or LoongArch LA64 and little-endian and 64-bit, or PowerPC and big-endian and 32-bit, or PowerPC-64 and 64-bit)) and non-crate feature bare only.
Expand description

A macro to create/query kernel version.

§Create a Version

kversion!(major [, minor [, revision]])

§Query version

kversion!( (>|<|==|>=|<=) major [, minor [, revision]])

§Examples

kversion!(4);          // Create version 4.0.0
kversion!(4, 11);      // Create version 4.11.0
kversion!(4, 11, 6)    // Create version 4.11.6
kversion!(>= 4);       // `true` if kernel version is 4.0.0 or superior
kversion!(< 4, 11);    // `true` if kernel version is earlier than 4.11.0
kversion!(== 5, 15, 6) // `true` if kernel is exactly 5.15.6