* [PATCH] kconfig: Use macros which are already defined
@ 2014-12-11 9:00 Michal Simek
2015-02-23 10:23 ` Michal Simek
0 siblings, 1 reply; 3+ messages in thread
From: Michal Simek @ 2014-12-11 9:00 UTC (permalink / raw)
To: linux-kernel, monstr
[-- Attachment #1: Type: text/plain, Size: 743 bytes --]
It is better to use macros which are already available
because then there is just one location which needs to be change.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
FYI: Fengguang's testing system doesn't show any build error.
---
include/linux/kconfig.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h
index be342b94c640..71acdf650e2e 100644
--- a/include/linux/kconfig.h
+++ b/include/linux/kconfig.h
@@ -28,7 +28,7 @@
*
*/
#define IS_ENABLED(option) \
- (config_enabled(option) || config_enabled(option##_MODULE))
+ (IS_BUILTIN(option) || IS_MODULE(option))
/*
* IS_BUILTIN(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y', 0
--
1.8.2.3
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] kconfig: Use macros which are already defined
2014-12-11 9:00 [PATCH] kconfig: Use macros which are already defined Michal Simek
@ 2015-02-23 10:23 ` Michal Simek
2015-02-26 21:23 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: Michal Simek @ 2015-02-23 10:23 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1254 bytes --]
Hi Andrew,
On 12/11/2014 10:00 AM, Michal Simek wrote:
> It is better to use macros which are already available
> because then there is just one location which needs to be change.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
> FYI: Fengguang's testing system doesn't show any build error.
> ---
> include/linux/kconfig.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h
> index be342b94c640..71acdf650e2e 100644
> --- a/include/linux/kconfig.h
> +++ b/include/linux/kconfig.h
> @@ -28,7 +28,7 @@
> *
> */
> #define IS_ENABLED(option) \
> - (config_enabled(option) || config_enabled(option##_MODULE))
> + (IS_BUILTIN(option) || IS_MODULE(option))
>
> /*
> * IS_BUILTIN(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y', 0
> --
> 1.8.2.3
>
Can you please add this to your queue?
Thanks,
Michal
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] kconfig: Use macros which are already defined
2015-02-23 10:23 ` Michal Simek
@ 2015-02-26 21:23 ` Andrew Morton
0 siblings, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2015-02-26 21:23 UTC (permalink / raw)
To: monstr; +Cc: linux-kernel
On Mon, 23 Feb 2015 11:23:14 +0100 Michal Simek <monstr@monstr.eu> wrote:
> Hi Andrew,
>
> On 12/11/2014 10:00 AM, Michal Simek wrote:
> > It is better to use macros which are already available
> > because then there is just one location which needs to be change.
> >
> > Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> > ---
> >
> > FYI: Fengguang's testing system doesn't show any build error.
> > ---
> > include/linux/kconfig.h | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h
> > index be342b94c640..71acdf650e2e 100644
> > --- a/include/linux/kconfig.h
> > +++ b/include/linux/kconfig.h
> > @@ -28,7 +28,7 @@
> > *
> > */
> > #define IS_ENABLED(option) \
> > - (config_enabled(option) || config_enabled(option##_MODULE))
> > + (IS_BUILTIN(option) || IS_MODULE(option))
> >
> > /*
> > * IS_BUILTIN(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y', 0
> > --
> > 1.8.2.3
> >
>
I can't find the original email anywhere, hrm.
As I received it, this patch is From:monstr@monstr.eu and
Signed-off-by:michal.simek@xilinx.com, which is unusual. Probably you
should be adding explicit From: lines to the patch changelogs to
override this.
After the patch, IS_ENABLED is defined before the macros which it uses.
That's not an error (unless someone puts an inlined function in there
before the IS_BUILTIN or IS_MODULE definitions), but it's unusual,
unexpected and illogical. So,
--- a/include/linux/kconfig.h~kconfig-use-macros-which-are-already-defined-fix
+++ a/include/linux/kconfig.h
@@ -23,14 +23,6 @@
#define ___config_enabled(__ignored, val, ...) val
/*
- * IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',
- * 0 otherwise.
- *
- */
-#define IS_ENABLED(option) \
- (IS_BUILTIN(option) || IS_MODULE(option))
-
-/*
* IS_BUILTIN(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y', 0
* otherwise. For boolean options, this is equivalent to
* IS_ENABLED(CONFIG_FOO).
@@ -43,4 +35,11 @@
*/
#define IS_MODULE(option) config_enabled(option##_MODULE)
+/*
+ * IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',
+ * 0 otherwise.
+ */
+#define IS_ENABLED(option) \
+ (IS_BUILTIN(option) || IS_MODULE(option))
+
#endif /* __LINUX_KCONFIG_H */
_
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-02-26 21:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-11 9:00 [PATCH] kconfig: Use macros which are already defined Michal Simek
2015-02-23 10:23 ` Michal Simek
2015-02-26 21:23 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox