Re: [PATCH v2 1/2] kconfig.h: Add IF_ENABLED() macro

2021-01-18 Thread Linus Walleij
Both patches applied! Yours, Linus Walleij

Re: [PATCH v2 1/2] kconfig.h: Add IF_ENABLED() macro

2021-01-15 Thread Arnd Bergmann
On Mon, Jan 11, 2021 at 9:45 AM Paul Cercueil wrote: > > Hi, > > Le lun. 14 déc. 2020 à 10:05, Linus Walleij > a écrit : > > On Mon, Dec 14, 2020 at 12:54 AM Paul Cercueil > > wrote: > > > >> IF_ENABLED(CONFIG_FOO, ptr) evaluates to (ptr) if CONFIG_FOO is set > >> to 'y' > >> or 'm', NULL othe

Re: [PATCH v2 1/2] kconfig.h: Add IF_ENABLED() macro

2021-01-11 Thread Paul Cercueil
Hi, Le lun. 14 déc. 2020 à 10:05, Linus Walleij a écrit : On Mon, Dec 14, 2020 at 12:54 AM Paul Cercueil wrote: IF_ENABLED(CONFIG_FOO, ptr) evaluates to (ptr) if CONFIG_FOO is set to 'y' or 'm', NULL otherwise. The (ptr) argument must be a pointer. The IF_ENABLED() macro can be very u

Re: [PATCH v2 1/2] kconfig.h: Add IF_ENABLED() macro

2020-12-14 Thread Linus Walleij
On Mon, Dec 14, 2020 at 12:54 AM Paul Cercueil wrote: > IF_ENABLED(CONFIG_FOO, ptr) evaluates to (ptr) if CONFIG_FOO is set to 'y' > or 'm', NULL otherwise. The (ptr) argument must be a pointer. > > The IF_ENABLED() macro can be very useful to help GCC drop dead code. I can apply this with the o

[PATCH v2 1/2] kconfig.h: Add IF_ENABLED() macro

2020-12-13 Thread Paul Cercueil
IF_ENABLED(CONFIG_FOO, ptr) evaluates to (ptr) if CONFIG_FOO is set to 'y' or 'm', NULL otherwise. The (ptr) argument must be a pointer. The IF_ENABLED() macro can be very useful to help GCC drop dead code. For instance, consider the following: #ifdef CONFIG_FOO_SUSPEND static int foo_su