Re: [PATCH 1/2] if_enabled.h: Add IF_ENABLED_OR_ELSE() and IF_ENABLED() macros

2020-12-09 Thread Paul Cercueil
Hi Linus, Le mer. 9 déc. 2020 à 9:59, Linus Walleij a écrit : On Tue, Dec 8, 2020 at 5:48 PM Paul Cercueil wrote: Introduce a new header , that brings two new macros: IF_ENABLED_OR_ELSE() and IF_ENABLED(). I understand what the patch is trying to do, but when we already have IS_ENABLE

Re: [PATCH 1/2] if_enabled.h: Add IF_ENABLED_OR_ELSE() and IF_ENABLED() macros

2020-12-09 Thread Paul Cercueil
Hi Ard, Le mer. 9 déc. 2020 à 10:38, Ard Biesheuvel a écrit : On Tue, 8 Dec 2020 at 17:49, Paul Cercueil wrote: Introduce a new header , that brings two new macros: IF_ENABLED_OR_ELSE() and IF_ENABLED(). IF_ENABLED_OR_ELSE(CONFIG_FOO, a, b) evaluates to (a) if CONFIG_FOO is set to

Re: [PATCH 1/2] if_enabled.h: Add IF_ENABLED_OR_ELSE() and IF_ENABLED() macros

2020-12-09 Thread Ard Biesheuvel
On Tue, 8 Dec 2020 at 17:49, Paul Cercueil wrote: > > Introduce a new header , that brings two new macros: > IF_ENABLED_OR_ELSE() and IF_ENABLED(). > > IF_ENABLED_OR_ELSE(CONFIG_FOO, a, b) evaluates to (a) if CONFIG_FOO is set > to 'y' or 'm', (b) otherwise. It is used internally to define the > I

Re: [PATCH 1/2] if_enabled.h: Add IF_ENABLED_OR_ELSE() and IF_ENABLED() macros

2020-12-09 Thread Linus Walleij
On Tue, Dec 8, 2020 at 5:48 PM Paul Cercueil wrote: > Introduce a new header , that brings two new macros: > IF_ENABLED_OR_ELSE() and IF_ENABLED(). I understand what the patch is trying to do, but when we already have IS_ENABLED() in this syntax becomes a big cognitive confusion for the mind.

Re: [PATCH 1/2] if_enabled.h: Add IF_ENABLED_OR_ELSE() and IF_ENABLED() macros

2020-12-08 Thread Paul Cercueil
Hi Randy, Le mar. 8 déc. 2020 à 9:39, Randy Dunlap a écrit : On 12/8/20 8:48 AM, Paul Cercueil wrote: Signed-off-by: Paul Cercueil Hi Paul, Why not just add these 2 new macros to ? Maybe you don't want to add the other 2 headers there also? That means including in , which causes b

Re: [PATCH 1/2] if_enabled.h: Add IF_ENABLED_OR_ELSE() and IF_ENABLED() macros

2020-12-08 Thread Randy Dunlap
On 12/8/20 8:48 AM, Paul Cercueil wrote: > > Signed-off-by: Paul Cercueil Hi Paul, Why not just add these 2 new macros to ? Maybe you don't want to add the other 2 headers there also? > --- > include/linux/if_enabled.h | 22 ++ > 1 file changed, 22 insertions(+) > creat

[PATCH 1/2] if_enabled.h: Add IF_ENABLED_OR_ELSE() and IF_ENABLED() macros

2020-12-08 Thread Paul Cercueil
Introduce a new header , that brings two new macros: IF_ENABLED_OR_ELSE() and IF_ENABLED(). IF_ENABLED_OR_ELSE(CONFIG_FOO, a, b) evaluates to (a) if CONFIG_FOO is set to 'y' or 'm', (b) otherwise. It is used internally to define the IF_ENABLED() macro. The (a) and (b) arguments must be of the same