Message ID | 20220603232940.21736-1-wsa+renesas@sang-engineering.com (mailing list archive) |
---|---|
State | Mainlined |
Commit | 290cedeca6fa315c54e056b7bdd3fdd99e5303eb |
Delegated to: | Geert Uytterhoeven |
Headers | show |
Series | arm64: dts: renesas: rzg2l-smarc: use proper bool operator | expand |
On 6/4/22 2:29 AM, Wolfram Sang wrote: > When checking for defined macros, we want the boolean AND not the binary > one. Do we need the parens though? > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> > --- > > Found while looking for examples of '#if' in dts files. > > arch/arm64/boot/dts/renesas/rzg2lc-smarc.dtsi | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm64/boot/dts/renesas/rzg2lc-smarc.dtsi b/arch/arm64/boot/dts/renesas/rzg2lc-smarc.dtsi > index aa170492dd2b..6be25a8a28db 100644 > --- a/arch/arm64/boot/dts/renesas/rzg2lc-smarc.dtsi > +++ b/arch/arm64/boot/dts/renesas/rzg2lc-smarc.dtsi > @@ -29,7 +29,7 @@ > #define SW_RSPI_CAN 1 > #endif > > -#if (SW_SCIF_CAN & SW_RSPI_CAN) > +#if (SW_SCIF_CAN && SW_RSPI_CAN) > #error "Can not set 1 to both SW_SCIF_CAN and SW_RSPI_CAN due to HW routing" > #endif > MBR, Sergey
> > When checking for defined macros, we want the boolean AND not the binary > > one. > > Do we need the parens though? For consistency with the rzg2lc-smarc files, I'd keep them. If we want to remove them, this should be a seperate patch over all files.
Hi Wolfram, On Mon, Jun 6, 2022 at 6:33 AM Wolfram Sang <wsa+renesas@sang-engineering.com> wrote: > When checking for defined macros, we want the boolean AND not the binary > one. Thanks for your patch! While it works fine in this case (both are either 0 or 1), I agree it's better to be consistent. > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> i.e. will queue in renesas-devel for v5.20. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
diff --git a/arch/arm64/boot/dts/renesas/rzg2lc-smarc.dtsi b/arch/arm64/boot/dts/renesas/rzg2lc-smarc.dtsi index aa170492dd2b..6be25a8a28db 100644 --- a/arch/arm64/boot/dts/renesas/rzg2lc-smarc.dtsi +++ b/arch/arm64/boot/dts/renesas/rzg2lc-smarc.dtsi @@ -29,7 +29,7 @@ #define SW_RSPI_CAN 1 #endif -#if (SW_SCIF_CAN & SW_RSPI_CAN) +#if (SW_SCIF_CAN && SW_RSPI_CAN) #error "Can not set 1 to both SW_SCIF_CAN and SW_RSPI_CAN due to HW routing" #endif
When checking for defined macros, we want the boolean AND not the binary one. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> --- Found while looking for examples of '#if' in dts files. arch/arm64/boot/dts/renesas/rzg2lc-smarc.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)