[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250313215744.69a976aa@pumpkin>
Date: Thu, 13 Mar 2025 21:57:44 +0000
From: David Laight <david.laight.linux@...il.com>
To: WangYuli <wangyuli@...ontech.com>
Cc: chenhuacai@...nel.org, kernel@...0n.name, yangtiezhu@...ngson.cn,
maobibo@...ngson.cn, guoweikang.kernel@...il.com, agordeev@...ux.ibm.com,
ast@...nel.org, usamaarif642@...il.com, jiaxun.yang@...goat.com,
loongarch@...ts.linux.dev, linux-kernel@...r.kernel.org,
zhanjun@...ontech.com, niecheng1@...ontech.com, chenlinxuan@...ontech.com,
donmor3000@...mail.com, Wentao Guan <guanwentao@...ontech.com>
Subject: Re: [PATCH] LoongArch: Fix use of logical '&&' with constant
operand
On Tue, 4 Mar 2025 18:52:46 +0800
WangYuli <wangyuli@...ontech.com> wrote:
> Fix follow error with clang-19:
>
> arch/loongarch/kernel/setup.c:335:40: error: use of logical '&&' with constant operand [-Werror,-Wconstant-logical-operand]
> 335 | if (IS_ENABLED(CONFIG_CMDLINE_EXTEND) && CONFIG_CMDLINE[0]) {
> | ^ ~~~~~~~~~~~~~~~~~
> arch/loongarch/kernel/setup.c:335:40: note: use '&' for a bitwise operation
> 335 | if (IS_ENABLED(CONFIG_CMDLINE_EXTEND) && CONFIG_CMDLINE[0]) {
> | ^~
> | &
> arch/loongarch/kernel/setup.c:335:40: note: remove constant to silence this warning
> 335 | if (IS_ENABLED(CONFIG_CMDLINE_EXTEND) && CONFIG_CMDLINE[0]) {
> | ^~~~~~~~~~~~~~~~~~~~
> 1 error generated.
Isn't that just 'an error too far' ?
There is nothing really wrong with compile-time constants in conditionals.
The kernel is full of them.
Why not just disable the warning?
David
Powered by blists - more mailing lists