* [PATCH] of: Use enum instead of macro to define flag
@ 2020-01-21 11:52 lijiazi
2020-02-03 11:53 ` Rob Herring
0 siblings, 1 reply; 2+ messages in thread
From: lijiazi @ 2020-01-21 11:52 UTC (permalink / raw)
To: Rob Herring, Frank Rowand, Sergey Senozhatsky; +Cc: lijiazi, devicetree
Use enum instead of macro to define device node flag.
And it seems that no need start with 1, so let's start with 0.
Suggested-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: lijiazi <lijiazi@xiaomi.com>
---
include/linux/of.h | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/include/linux/of.h b/include/linux/of.h
index c669c0a..b90936c0 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -140,12 +140,14 @@ extern raw_spinlock_t devtree_lock;
* struct device_node flag descriptions
* (need to be visible even when !CONFIG_OF)
*/
-#define OF_DYNAMIC 1 /* (and properties) allocated via kmalloc */
-#define OF_DETACHED 2 /* detached from the device tree */
-#define OF_POPULATED 3 /* device already created */
-#define OF_POPULATED_BUS 4 /* platform bus created for children */
-#define OF_OVERLAY 5 /* allocated for an overlay */
-#define OF_OVERLAY_FREE_CSET 6 /* in overlay cset being freed */
+enum of_device_node_flag {
+ OF_DYNAMIC = 0, /* (and properties) allocated via kmalloc */
+ OF_DETACHED, /* detached from the device tree */
+ OF_POPULATED, /* device already created */
+ OF_POPULATED_BUS, /* platform bus created for children */
+ OF_OVERLAY, /* allocated for an overlay */
+ OF_OVERLAY_FREE_CSET, /* in overlay cset being freed */
+};
#define OF_BAD_ADDR ((u64)-1)
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] of: Use enum instead of macro to define flag
2020-01-21 11:52 [PATCH] of: Use enum instead of macro to define flag lijiazi
@ 2020-02-03 11:53 ` Rob Herring
0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring @ 2020-02-03 11:53 UTC (permalink / raw)
To: lijiazi; +Cc: Frank Rowand, Sergey Senozhatsky, lijiazi, devicetree
On Tue, Jan 21, 2020 at 07:52:36PM +0800, lijiazi wrote:
> Use enum instead of macro to define device node flag.
> And it seems that no need start with 1, so let's start with 0.
Yes, the diff tells me all this. What's missing is why?
I assume this has something to do with the vsprintf changes? Is this a
dependency?
On it's own, this seems like needless churn.
>
> Suggested-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> Signed-off-by: lijiazi <lijiazi@xiaomi.com>
Need a full name here.
> ---
> include/linux/of.h | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/include/linux/of.h b/include/linux/of.h
> index c669c0a..b90936c0 100644
> --- a/include/linux/of.h
> +++ b/include/linux/of.h
> @@ -140,12 +140,14 @@ extern raw_spinlock_t devtree_lock;
> * struct device_node flag descriptions
> * (need to be visible even when !CONFIG_OF)
> */
> -#define OF_DYNAMIC 1 /* (and properties) allocated via kmalloc */
> -#define OF_DETACHED 2 /* detached from the device tree */
> -#define OF_POPULATED 3 /* device already created */
> -#define OF_POPULATED_BUS 4 /* platform bus created for children */
> -#define OF_OVERLAY 5 /* allocated for an overlay */
> -#define OF_OVERLAY_FREE_CSET 6 /* in overlay cset being freed */
> +enum of_device_node_flag {
> + OF_DYNAMIC = 0, /* (and properties) allocated via kmalloc */
> + OF_DETACHED, /* detached from the device tree */
> + OF_POPULATED, /* device already created */
> + OF_POPULATED_BUS, /* platform bus created for children */
> + OF_OVERLAY, /* allocated for an overlay */
> + OF_OVERLAY_FREE_CSET, /* in overlay cset being freed */
> +};
>
> #define OF_BAD_ADDR ((u64)-1)
>
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-02-03 11:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-21 11:52 [PATCH] of: Use enum instead of macro to define flag lijiazi
2020-02-03 11:53 ` Rob Herring
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.