lkml.org 
[lkml]   [2021]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [GIT PULL] KVM fixes for Linux 5.15-rc7
From
On 18/10/21 19:57, Linus Torvalds wrote:
> The way to do a logical "or" (instead of a bitwise one on two boolean
> expressions) is to use "||".
>
> Instead, the code was changed to completely insane
>
> (int) boolexpr1 | (int) boolexpr2
>
> thing, which is entirely illegible and pointless, and no sane person
> should ever write code like that.
>
> In other words, the*proper* fix to a warning is to look at the code,
> and*unsderstand* the code and the warning, instead of some mindless
> conversion to just avoid a warning.

The code is not wrong, there is a comment explaining it:

* Use a bitwise-OR instead of a logical-OR to aggregate the reserved
* bits and EPT's invalid memtype/XWR checks to avoid an extra Jcc
* (this is extremely unlikely to be short-circuited as true).

Paolo

\
 
 \ /
  Last update: 2021-10-18 20:03    [W:0.269 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site