Re: [PATCH] kbuild: treat char as always signed
Thread information
[Search the linux-kernel archive]
Jason A. Donenfeld ` Segher Boessenkool ` Linus Torvalds ` Linus Torvalds ` Nick Desaulniers ` Linus Torvalds ` Andy Shevchenko ` Linus Torvalds [this message] ` Segher Boessenkool ` Linus Torvalds ` Nick Desaulniers ` Linus Torvalds ` Kees Cook ` Linus Torvalds ` Jason A. Donenfeld ` Linus Torvalds ` Jason A. Donenfeld ` Segher Boessenkool ` David Laight ` Segher Boessenkool ` Gabriel Paubert ` Linus Torvalds ` Gabriel Paubert ` Linus Torvalds ` Gabriel Paubert ` Kees Cook ` Jason A. Donenfeld ` Kees Cook ` Linus Torvalds ` Jason A. Donenfeld ` [PATCH v2] kbuild: treat char as always unsigned Jason A. Donenfeld ` Linus Torvalds ` Jason A. Donenfeld ` Linus Torvalds ` Jason A. Donenfeld ` Kees Cook ` Jason A. Donenfeld ` Segher Boessenkool ` Dan Carpenter ` Dan Carpenter ` Jason A. Donenfeld ` Linus Torvalds ` Jason A. Donenfeld ` Kalle Valo ` David Laight ` Jason A. Donenfeld ` Guenter Roeck ` Geert Uytterhoeven ` Guenter Roeck ` Rasmus Villemoes ` Guenter Roeck ` Linus Torvalds ` Guenter Roeck ` Linus Torvalds ` Linus Torvalds ` Guenter Roeck ` Geert Uytterhoeven ` David Laight ` Geert Uytterhoeven ` David Laight ` David Laight ` Geert Uytterhoeven ` Andreas Schwab ` Geert Uytterhoeven ` [PATCH] kbuild: treat char as always signed David Laight ` make ctype ascii only? (was [PATCH] kbuild: treat char as always signed) Rasmus Villemoes ` Linus Torvalds ` Rasmus Villemoes ` Linus Torvalds ` [PATCH] kbuild: treat char as always signed kernel test robot ` Jason A. Donenfeld
From: | Linus Torvalds <torvalds-AT-linux-foundation.org> | |
To: | Andy Shevchenko <andriy.shevchenko-AT-linux.intel.com> | |
Subject: | Re: [PATCH] kbuild: treat char as always signed | |
Date: | Wed, 19 Oct 2022 12:36:01 -0700 | |
Message-ID: | <CAHk-=wgoH_rZiv84-53dGF5btC-1FPZc9nFJM=48NVAmR1p7Sw@mail.gmail.com> | |
Cc: | Nick Desaulniers <ndesaulniers-AT-google.com>, Segher Boessenkool <segher-AT-kernel.crashing.org>, "Jason A. Donenfeld" <Jason-AT-zx2c4.com>, linux-kernel-AT-vger.kernel.org, linux-kbuild-AT-vger.kernel.org, linux-arch-AT-vger.kernel.org, linux-toolchains-AT-vger.kernel.org, Masahiro Yamada <masahiroy-AT-kernel.org>, Kees Cook <keescook-AT-chromium.org>, Andrew Morton <akpm-AT-linux-foundation.org>, Greg Kroah-Hartman <gregkh-AT-linuxfoundation.org> |
On Wed, Oct 19, 2022 at 12:23 PM Andy Shevchenko <[email protected]> wrote: > > > We do have a couple of signed bitfields in the kernel, but they are > > unusual enough that it's actually a good thing that sparse just made > > people be explicit about it. > > At least drivers/media/usb/msi2500/msi2500.c:289 can be converted > to use sign_extend32() I believe. Heh. I didn't even look at that one - I did check that yeah, the MIPS ones made sense (I say "ones", because while my grep pattern only finds one, there are several others that have spacing that just made my grep miss them). You're right, that msi2500 use is a very odd use of bitfields for just sign extension. That's hilariously odd code, but not exactly wrong. And using "signed int x:14" does make it very explicit that the bitfield wants that sign. And that code does actually have a fair number of comments to explain each step, so I think it's all ok. Strange, but ok. Linus