[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wi-UJAGo6uwYx8XKydSEsnQ33mW4t+kUnb+CNY+Oxobjg@mail.gmail.com>
Date: Mon, 18 Oct 2021 20:27:02 -1000
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Nathan Chancellor <nathan@...nel.org>
Cc: Nick Desaulniers <ndesaulniers@...gle.com>,
Henrique de Moraes Holschuh <hmh@....eng.br>,
Hans de Goede <hdegoede@...hat.com>,
Mark Gross <markgross@...nel.org>,
ibm-acpi-devel@...ts.sourceforge.net,
platform-driver-x86@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
llvm@...ts.linux.dev, Tor Vic <torvic9@...lbox.org>
Subject: Re: [PATCH] platform/x86: thinkpad_acpi: Fix bitwise vs. logical warning
On Mon, Oct 18, 2021 at 7:00 PM Nathan Chancellor <nathan@...nel.org> wrote:
>
> For what it's worth, the suggested fix is the '||' underneath the
> warning text:
>
> In file included from arch/x86/kvm/mmu/tdp_iter.c:5:
> arch/x86/kvm/mmu/spte.h:318:9: error: use of bitwise '|' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
> return __is_bad_mt_xwr(rsvd_check, spte) |
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ||
> arch/x86/kvm/mmu/spte.h:318:9: note: cast one or both operands to int to silence this warning
> 1 error generated.
Hmm. That's not at all obvious.
The *much* bigger part is that
note: cast one or both operands to int to silence this warning
which is what I'm complaining about. That note should die. It should
say "maybe you meant to use a logical or" or something like that.
> Perhaps that hint should also be added to the warning text, like:
>
> In file included from arch/x86/kvm/mmu/tdp_iter.c:5:
> arch/x86/kvm/mmu/spte.h:318:9: error: use of bitwise '|' with boolean operands; did you mean logical '||'? [-Werror,-Wbitwise-instead-of-logical]
> return __is_bad_mt_xwr(rsvd_check, spte) |
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ||
> arch/x86/kvm/mmu/spte.h:318:9: note: cast one or both operands to int to silence this warning
I don't understand why you seem to continue to ignore the "note"
message, which makes a completely crazy suggestion.
Linus
Powered by blists - more mailing lists