fix(copyfile): inline linux/version.h#12901
Conversation
The kernel headers cannot be expected to be available on every linux distribution. The version header can therefore be inlined easily. In the kernel, the generated file looks like: ``` define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + \ ((c) > 255 ? 255 : (c)))'; ``` but we don't really need the extra check on `c`. Signed-off-by: Ali Caglayan <alizter@gmail.com>
nojb
left a comment
There was a problem hiding this comment.
LGTM
Duplicating the exact definition from the kernel headers is not necessary; any definition that allows comparing with < would be sufficient, but using the same one as in the kernel headers works, of course.
Just to be clear, because I think I worded it a bit confusingly, this isn't exactly the same as the kernel version. Only the |
Right, thanks, I had missed the point of your comment. The extra check in the kernel is to avoid overflow (see https://lwn.net/Articles/845120/). Not including it has the effect that the calculated version is sometimes "higher" than one would expect (eg |
|
Doesn't need a changelog since we are fixing a regression since 3.20. |
The kernel headers cannot be expected to be available on every linux distribution. The version header can therefore be inlined easily.
In the kernel, the generated file looks like:
but we don't really need the extra check on
c.fix #12896.