<div dir="ltr"><div dir="ltr">On Mon, May 15, 2023 at 9:51 AM HAGIO KAZUHITO(萩尾 一仁) <<a href="mailto:k-hagio-ab@nec.com">k-hagio-ab@nec.com</a>> wrote:</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> Do you mean the following changes can not work?<br>
> <br>
> #define THIS_KERNEL_VERSION ((kt->kernel_version[0] << 16) + \<br>
>                               (kt->kernel_version[1] << 8) + \<br>
>                               ((kt->kernel_version[2] > 255) ? 255 :<br>
> (kt->kernel_version[2])))<br>
> #define LINUX(x,y,z) (((uint)(x) << 16) + ((uint)(y) << 8) + ((uint)(z) ><br>
> 255 ? 255 : (uint)(z)))<br>
<br>
No, in the current crash, this will work.  Because there is no <br>
if-conditional that checks a revision value over 255.<br>
<br>
>     if (THIS_KERNEL_VERSION < LINUX(4,14,300))<br>
<br>
But yes, when we need to check like this, the above cannot work.  For <br>
example, THIS_KERNEL_VERSION on 4.14.310 equals to LINUX(4,14,300).<br>
<br></blockquote><div><br></div><div>Thank you for the explanation, Kazu.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
So, my thought is that it would be better to change the shift amounts <br>
now for future changes with the small effort, rather than change it <br>
again in the future.<br>
<br></blockquote><div> </div><div>There is a similar discussion in the kernel here, but not sure why it was not accepted.</div><div><a href="https://lore.kernel.org/lkml/20210206035033.2036180-3-sashal@kernel.org/">https://lore.kernel.org/lkml/20210206035033.2036180-3-sashal@kernel.org/</a></div><div><br></div><div>But anyway, it is just a small change, and also fine to me. So: Ack.</div><div><br></div><div>Thanks.</div><div>Lianbo</div></div></div>