[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250719105228.1704538d@pumpkin>
Date: Sat, 19 Jul 2025 10:52:28 +0100
From: David Laight <david.laight.linux@...il.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: "H. Peter Anvin" <hpa@...or.com>, Eugenio Pérez
<eperezma@...hat.com>, Ilpo Järvinen
<ilpo.jarvinen@...ux.intel.com>, "Michael S. Tsirkin" <mst@...hat.com>, Al
Viro <viro@...iv.linux.org.uk>, Alexei Starovoitov <ast@...nel.org>, Alexey
Dobriyan <adobriyan@...il.com>, Andrew Morton <akpm@...ux-foundation.org>,
Andrii Nakryiko <andrii@...nel.org>, Arnd Bergmann <arnd@...nel.org>,
Borislav Petkov <bp@...en8.de>, Cong Wang <cong.wang@...edance.com>, Dan
Williams <dan.j.williams@...el.com>, Daniel Borkmann
<daniel@...earbox.net>, Dave Hansen <dave.hansen@...ux.intel.com>, David
Laight <David.Laight@...lab.com>, David Lechner <dlechner@...libre.com>,
Dinh Nguyen <dinguyen@...nel.org>, Eduard Zingerman <eddyz87@...il.com>,
Gatlin Newhouse <gatlin.newhouse@...il.com>, Hao Luo <haoluo@...gle.com>,
Ingo Molnar <mingo@...hat.com>, Jakub Sitnicki <jakub@...udflare.com>, Jan
Hendrik Farr <kernel@...rr.cc>, Jason Wang <jasowang@...hat.com>, Jiri Olsa
<jolsa@...nel.org>, John Fastabend <john.fastabend@...il.com>, Jonathan
Cameron <Jonathan.Cameron@...wei.com>, Josh Poimboeuf
<jpoimboe@...nel.org>, KP Singh <kpsingh@...nel.org>, Kees Cook
<kees@...nel.org>, Luc Van Oostenryck <luc.vanoostenryck@...il.com>, Marc
Herbert <Marc.Herbert@...ux.intel.com>, Martin KaFai Lau
<martin.lau@...ux.dev>, Mateusz Guzik <mjguzik@...il.com>, Michal Luczaj
<mhal@...x.co>, Miguel Ojeda <ojeda@...nel.org>, Mykola Lysenko
<mykolal@...com>, NeilBrown <neil@...wn.name>, Peter Zijlstra
<peterz@...radead.org>, Przemek Kitszel <przemyslaw.kitszel@...el.com>,
Sami Tolvanen <samitolvanen@...gle.com>, Shuah Khan <shuah@...nel.org>,
Song Liu <song@...nel.org>, Stanislav Fomichev <sdf@...ichev.me>, Thomas
Gleixner <tglx@...utronix.de>, Thorsten Blum <thorsten.blum@...ux.dev>,
Uros Bizjak <ubizjak@...il.com>, Xuan Zhuo <xuanzhuo@...ux.alibaba.com>,
Yafang Shao <laoar.shao@...il.com>, Ye Bin <yebin10@...wei.com>, Yonghong
Song <yonghong.song@...ux.dev>, Yufeng Wang <wangyufeng@...inos.cn>,
bpf@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
linux-sparse@...r.kernel.org, virtualization@...ts.linux.dev,
x86@...nel.org
Subject: Re: [PATCH 4/7] arch/nios: replace "__auto_type" with "auto"
On Fri, 18 Jul 2025 14:49:41 -0700
Linus Torvalds <torvalds@...ux-foundation.org> wrote:
...
> Side note: I think some coccinelle (or sed) script that replaces that
> older form of
>
> typeof(x) Y = (typeof(x))(Z);
...
>
> with just
>
> auto Y = Z;
>
> is also worthwhile at some point.
That one needs to keep the typeof() - but the cast might be spurious.
It could be either:
typeof(x) Y = Z;
or:
auto Y = (typeof(x))(Z);
but the latter could hide compilation errors.
I'm waiting for the next 'duck shoot' (after strings) to be casts.
While casts of 'buffer' to/from 'void *' are fine (and not needed),
casts to/from 'integer_type *' are definitely problematic.
And 'random' casts of integer values could easily hide real bugs
and most just aren't needed.
Although you might want the compiler to make the result of
'u64_var & 0xffu' 'unsigned int'.
David
Powered by blists - more mailing lists