All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen: cpu: change 'cpu_hotplug_[begin|done]' to inline function
@ 2019-05-31  2:46 ` Baodong Chen
  0 siblings, 0 replies; 18+ messages in thread
From: Baodong Chen @ 2019-05-31  2:46 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Julien Grall, Jan Beulich, Baodong Chen

Signed-off-by: Baodong Chen <chenbaodong@mxnavi.com>
---
 xen/common/cpu.c      | 10 ----------
 xen/include/xen/cpu.h |  4 ++--
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/xen/common/cpu.c b/xen/common/cpu.c
index f388d89..a526b55 100644
--- a/xen/common/cpu.c
+++ b/xen/common/cpu.c
@@ -51,16 +51,6 @@ void put_cpu_maps(void)
     spin_unlock_recursive(&cpu_add_remove_lock);
 }
 
-bool_t cpu_hotplug_begin(void)
-{
-    return get_cpu_maps();
-}
-
-void cpu_hotplug_done(void)
-{
-    put_cpu_maps();
-}
-
 static NOTIFIER_HEAD(cpu_chain);
 
 void __init register_cpu_notifier(struct notifier_block *nb)
diff --git a/xen/include/xen/cpu.h b/xen/include/xen/cpu.h
index 4638c50..70a2df4 100644
--- a/xen/include/xen/cpu.h
+++ b/xen/include/xen/cpu.h
@@ -10,8 +10,8 @@ bool_t get_cpu_maps(void);
 void put_cpu_maps(void);
 
 /* Safely perform CPU hotplug and update cpu_online_map, etc. */
-bool_t cpu_hotplug_begin(void);
-void cpu_hotplug_done(void);
+static inline bool_t cpu_hotplug_begin(void) { return get_cpu_maps(); }
+static inline void cpu_hotplug_done(void) { put_cpu_maps(); }
 
 /* Receive notification of CPU hotplug events. */
 void register_cpu_notifier(struct notifier_block *nb);
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Xen-devel] [PATCH] xen: cpu: change 'cpu_hotplug_[begin|done]' to inline function
@ 2019-05-31  2:46 ` Baodong Chen
  0 siblings, 0 replies; 18+ messages in thread
From: Baodong Chen @ 2019-05-31  2:46 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Julien Grall, Jan Beulich, Baodong Chen

Signed-off-by: Baodong Chen <chenbaodong@mxnavi.com>
---
 xen/common/cpu.c      | 10 ----------
 xen/include/xen/cpu.h |  4 ++--
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/xen/common/cpu.c b/xen/common/cpu.c
index f388d89..a526b55 100644
--- a/xen/common/cpu.c
+++ b/xen/common/cpu.c
@@ -51,16 +51,6 @@ void put_cpu_maps(void)
     spin_unlock_recursive(&cpu_add_remove_lock);
 }
 
-bool_t cpu_hotplug_begin(void)
-{
-    return get_cpu_maps();
-}
-
-void cpu_hotplug_done(void)
-{
-    put_cpu_maps();
-}
-
 static NOTIFIER_HEAD(cpu_chain);
 
 void __init register_cpu_notifier(struct notifier_block *nb)
diff --git a/xen/include/xen/cpu.h b/xen/include/xen/cpu.h
index 4638c50..70a2df4 100644
--- a/xen/include/xen/cpu.h
+++ b/xen/include/xen/cpu.h
@@ -10,8 +10,8 @@ bool_t get_cpu_maps(void);
 void put_cpu_maps(void);
 
 /* Safely perform CPU hotplug and update cpu_online_map, etc. */
-bool_t cpu_hotplug_begin(void);
-void cpu_hotplug_done(void);
+static inline bool_t cpu_hotplug_begin(void) { return get_cpu_maps(); }
+static inline void cpu_hotplug_done(void) { put_cpu_maps(); }
 
 /* Receive notification of CPU hotplug events. */
 void register_cpu_notifier(struct notifier_block *nb);
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH] xen: cpu: change 'cpu_hotplug_[begin|done]' to inline function
@ 2019-05-31 10:55   ` Julien Grall
  0 siblings, 0 replies; 18+ messages in thread
From: Julien Grall @ 2019-05-31 10:55 UTC (permalink / raw)
  To: Baodong Chen, xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Jan Beulich

Hi,

On 5/31/19 3:46 AM, Baodong Chen wrote:
> Signed-off-by: Baodong Chen <chenbaodong@mxnavi.com>
> ---
>   xen/common/cpu.c      | 10 ----------
>   xen/include/xen/cpu.h |  4 ++--
>   2 files changed, 2 insertions(+), 12 deletions(-)
> 
> diff --git a/xen/common/cpu.c b/xen/common/cpu.c
> index f388d89..a526b55 100644
> --- a/xen/common/cpu.c
> +++ b/xen/common/cpu.c
> @@ -51,16 +51,6 @@ void put_cpu_maps(void)
>       spin_unlock_recursive(&cpu_add_remove_lock);
>   }
>   
> -bool_t cpu_hotplug_begin(void)
> -{
> -    return get_cpu_maps();
> -}
> -
> -void cpu_hotplug_done(void)
> -{
> -    put_cpu_maps();
> -}
> -
>   static NOTIFIER_HEAD(cpu_chain);
>   
>   void __init register_cpu_notifier(struct notifier_block *nb)
> diff --git a/xen/include/xen/cpu.h b/xen/include/xen/cpu.h
> index 4638c50..70a2df4 100644
> --- a/xen/include/xen/cpu.h
> +++ b/xen/include/xen/cpu.h
> @@ -10,8 +10,8 @@ bool_t get_cpu_maps(void);
>   void put_cpu_maps(void);
>   
>   /* Safely perform CPU hotplug and update cpu_online_map, etc. */
> -bool_t cpu_hotplug_begin(void);
> -void cpu_hotplug_done(void);
> +static inline bool_t cpu_hotplug_begin(void) { return get_cpu_maps(); }
> +static inline void cpu_hotplug_done(void) { put_cpu_maps(); }

The coding style should be:

static inline....
{
       ...
}

>   
>   /* Receive notification of CPU hotplug events. */
>   void register_cpu_notifier(struct notifier_block *nb);
> 

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xen-devel] [PATCH] xen: cpu: change 'cpu_hotplug_[begin|done]' to inline function
@ 2019-05-31 10:55   ` Julien Grall
  0 siblings, 0 replies; 18+ messages in thread
From: Julien Grall @ 2019-05-31 10:55 UTC (permalink / raw)
  To: Baodong Chen, xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Jan Beulich

Hi,

On 5/31/19 3:46 AM, Baodong Chen wrote:
> Signed-off-by: Baodong Chen <chenbaodong@mxnavi.com>
> ---
>   xen/common/cpu.c      | 10 ----------
>   xen/include/xen/cpu.h |  4 ++--
>   2 files changed, 2 insertions(+), 12 deletions(-)
> 
> diff --git a/xen/common/cpu.c b/xen/common/cpu.c
> index f388d89..a526b55 100644
> --- a/xen/common/cpu.c
> +++ b/xen/common/cpu.c
> @@ -51,16 +51,6 @@ void put_cpu_maps(void)
>       spin_unlock_recursive(&cpu_add_remove_lock);
>   }
>   
> -bool_t cpu_hotplug_begin(void)
> -{
> -    return get_cpu_maps();
> -}
> -
> -void cpu_hotplug_done(void)
> -{
> -    put_cpu_maps();
> -}
> -
>   static NOTIFIER_HEAD(cpu_chain);
>   
>   void __init register_cpu_notifier(struct notifier_block *nb)
> diff --git a/xen/include/xen/cpu.h b/xen/include/xen/cpu.h
> index 4638c50..70a2df4 100644
> --- a/xen/include/xen/cpu.h
> +++ b/xen/include/xen/cpu.h
> @@ -10,8 +10,8 @@ bool_t get_cpu_maps(void);
>   void put_cpu_maps(void);
>   
>   /* Safely perform CPU hotplug and update cpu_online_map, etc. */
> -bool_t cpu_hotplug_begin(void);
> -void cpu_hotplug_done(void);
> +static inline bool_t cpu_hotplug_begin(void) { return get_cpu_maps(); }
> +static inline void cpu_hotplug_done(void) { put_cpu_maps(); }

The coding style should be:

static inline....
{
       ...
}

>   
>   /* Receive notification of CPU hotplug events. */
>   void register_cpu_notifier(struct notifier_block *nb);
> 

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] xen: cpu: change 'cpu_hotplug_[begin|done]' to inline function
@ 2019-05-31 11:30     ` Jan Beulich
  0 siblings, 0 replies; 18+ messages in thread
From: Jan Beulich @ 2019-05-31 11:30 UTC (permalink / raw)
  To: Baodong Chen
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Julien Grall, xen-devel

>>> On 31.05.19 at 12:55, <julien.grall@arm.com> wrote:
> On 5/31/19 3:46 AM, Baodong Chen wrote:
>> --- a/xen/include/xen/cpu.h
>> +++ b/xen/include/xen/cpu.h
>> @@ -10,8 +10,8 @@ bool_t get_cpu_maps(void);
>>   void put_cpu_maps(void);
>>   
>>   /* Safely perform CPU hotplug and update cpu_online_map, etc. */
>> -bool_t cpu_hotplug_begin(void);
>> -void cpu_hotplug_done(void);
>> +static inline bool_t cpu_hotplug_begin(void) { return get_cpu_maps(); }
>> +static inline void cpu_hotplug_done(void) { put_cpu_maps(); }

Plus please switch to bool at the same time.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xen-devel] [PATCH] xen: cpu: change 'cpu_hotplug_[begin|done]' to inline function
@ 2019-05-31 11:30     ` Jan Beulich
  0 siblings, 0 replies; 18+ messages in thread
From: Jan Beulich @ 2019-05-31 11:30 UTC (permalink / raw)
  To: Baodong Chen
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Julien Grall, xen-devel

>>> On 31.05.19 at 12:55, <julien.grall@arm.com> wrote:
> On 5/31/19 3:46 AM, Baodong Chen wrote:
>> --- a/xen/include/xen/cpu.h
>> +++ b/xen/include/xen/cpu.h
>> @@ -10,8 +10,8 @@ bool_t get_cpu_maps(void);
>>   void put_cpu_maps(void);
>>   
>>   /* Safely perform CPU hotplug and update cpu_online_map, etc. */
>> -bool_t cpu_hotplug_begin(void);
>> -void cpu_hotplug_done(void);
>> +static inline bool_t cpu_hotplug_begin(void) { return get_cpu_maps(); }
>> +static inline void cpu_hotplug_done(void) { put_cpu_maps(); }

Plus please switch to bool at the same time.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] xen: cpu: change 'cpu_hotplug_[begin|done]' to inline function
@ 2019-06-03  1:52     ` chenbaodong
  0 siblings, 0 replies; 18+ messages in thread
From: chenbaodong @ 2019-06-03  1:52 UTC (permalink / raw)
  To: Julien Grall, xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Jan Beulich


On 5/31/19 18:55, Julien Grall wrote:
> Hi,
>
> On 5/31/19 3:46 AM, Baodong Chen wrote:
>> Signed-off-by: Baodong Chen <chenbaodong@mxnavi.com>
>> ---
>>   xen/common/cpu.c      | 10 ----------
>>   xen/include/xen/cpu.h |  4 ++--
>>   2 files changed, 2 insertions(+), 12 deletions(-)
>>
>> diff --git a/xen/common/cpu.c b/xen/common/cpu.c
>> index f388d89..a526b55 100644
>> --- a/xen/common/cpu.c
>> +++ b/xen/common/cpu.c
>> @@ -51,16 +51,6 @@ void put_cpu_maps(void)
>>       spin_unlock_recursive(&cpu_add_remove_lock);
>>   }
>>   -bool_t cpu_hotplug_begin(void)
>> -{
>> -    return get_cpu_maps();
>> -}
>> -
>> -void cpu_hotplug_done(void)
>> -{
>> -    put_cpu_maps();
>> -}
>> -
>>   static NOTIFIER_HEAD(cpu_chain);
>>     void __init register_cpu_notifier(struct notifier_block *nb)
>> diff --git a/xen/include/xen/cpu.h b/xen/include/xen/cpu.h
>> index 4638c50..70a2df4 100644
>> --- a/xen/include/xen/cpu.h
>> +++ b/xen/include/xen/cpu.h
>> @@ -10,8 +10,8 @@ bool_t get_cpu_maps(void);
>>   void put_cpu_maps(void);
>>     /* Safely perform CPU hotplug and update cpu_online_map, etc. */
>> -bool_t cpu_hotplug_begin(void);
>> -void cpu_hotplug_done(void);
>> +static inline bool_t cpu_hotplug_begin(void) { return get_cpu_maps(); }
>> +static inline void cpu_hotplug_done(void) { put_cpu_maps(); }
>
> The coding style should be:
>
> static inline....
> {
>       ...
> }
>
Yes, clang-format automated format code for me, will be fixed.
>>     /* Receive notification of CPU hotplug events. */
>>   void register_cpu_notifier(struct notifier_block *nb);
>>
>
> Cheers,
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xen-devel] [PATCH] xen: cpu: change 'cpu_hotplug_[begin|done]' to inline function
@ 2019-06-03  1:52     ` chenbaodong
  0 siblings, 0 replies; 18+ messages in thread
From: chenbaodong @ 2019-06-03  1:52 UTC (permalink / raw)
  To: Julien Grall, xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Jan Beulich


On 5/31/19 18:55, Julien Grall wrote:
> Hi,
>
> On 5/31/19 3:46 AM, Baodong Chen wrote:
>> Signed-off-by: Baodong Chen <chenbaodong@mxnavi.com>
>> ---
>>   xen/common/cpu.c      | 10 ----------
>>   xen/include/xen/cpu.h |  4 ++--
>>   2 files changed, 2 insertions(+), 12 deletions(-)
>>
>> diff --git a/xen/common/cpu.c b/xen/common/cpu.c
>> index f388d89..a526b55 100644
>> --- a/xen/common/cpu.c
>> +++ b/xen/common/cpu.c
>> @@ -51,16 +51,6 @@ void put_cpu_maps(void)
>>       spin_unlock_recursive(&cpu_add_remove_lock);
>>   }
>>   -bool_t cpu_hotplug_begin(void)
>> -{
>> -    return get_cpu_maps();
>> -}
>> -
>> -void cpu_hotplug_done(void)
>> -{
>> -    put_cpu_maps();
>> -}
>> -
>>   static NOTIFIER_HEAD(cpu_chain);
>>     void __init register_cpu_notifier(struct notifier_block *nb)
>> diff --git a/xen/include/xen/cpu.h b/xen/include/xen/cpu.h
>> index 4638c50..70a2df4 100644
>> --- a/xen/include/xen/cpu.h
>> +++ b/xen/include/xen/cpu.h
>> @@ -10,8 +10,8 @@ bool_t get_cpu_maps(void);
>>   void put_cpu_maps(void);
>>     /* Safely perform CPU hotplug and update cpu_online_map, etc. */
>> -bool_t cpu_hotplug_begin(void);
>> -void cpu_hotplug_done(void);
>> +static inline bool_t cpu_hotplug_begin(void) { return get_cpu_maps(); }
>> +static inline void cpu_hotplug_done(void) { put_cpu_maps(); }
>
> The coding style should be:
>
> static inline....
> {
>       ...
> }
>
Yes, clang-format automated format code for me, will be fixed.
>>     /* Receive notification of CPU hotplug events. */
>>   void register_cpu_notifier(struct notifier_block *nb);
>>
>
> Cheers,
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] xen: cpu: change 'cpu_hotplug_[begin|done]' to inline function
@ 2019-06-03  1:56       ` chenbaodong
  0 siblings, 0 replies; 18+ messages in thread
From: chenbaodong @ 2019-06-03  1:56 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Julien Grall, xen-devel


On 5/31/19 19:30, Jan Beulich wrote:
>>>> On 31.05.19 at 12:55, <julien.grall@arm.com> wrote:
>> On 5/31/19 3:46 AM, Baodong Chen wrote:
>>> --- a/xen/include/xen/cpu.h
>>> +++ b/xen/include/xen/cpu.h
>>> @@ -10,8 +10,8 @@ bool_t get_cpu_maps(void);
>>>    void put_cpu_maps(void);
>>>    
>>>    /* Safely perform CPU hotplug and update cpu_online_map, etc. */
>>> -bool_t cpu_hotplug_begin(void);
>>> -void cpu_hotplug_done(void);
>>> +static inline bool_t cpu_hotplug_begin(void) { return get_cpu_maps(); }
>>> +static inline void cpu_hotplug_done(void) { put_cpu_maps(); }
> Plus please switch to bool at the same time.

Yes, types like boot_t or u32 are getting rid of, so should Not be used.

Will be fixed.

>
> Jan
>
>
> .
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xen-devel] [PATCH] xen: cpu: change 'cpu_hotplug_[begin|done]' to inline function
@ 2019-06-03  1:56       ` chenbaodong
  0 siblings, 0 replies; 18+ messages in thread
From: chenbaodong @ 2019-06-03  1:56 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Julien Grall, xen-devel


On 5/31/19 19:30, Jan Beulich wrote:
>>>> On 31.05.19 at 12:55, <julien.grall@arm.com> wrote:
>> On 5/31/19 3:46 AM, Baodong Chen wrote:
>>> --- a/xen/include/xen/cpu.h
>>> +++ b/xen/include/xen/cpu.h
>>> @@ -10,8 +10,8 @@ bool_t get_cpu_maps(void);
>>>    void put_cpu_maps(void);
>>>    
>>>    /* Safely perform CPU hotplug and update cpu_online_map, etc. */
>>> -bool_t cpu_hotplug_begin(void);
>>> -void cpu_hotplug_done(void);
>>> +static inline bool_t cpu_hotplug_begin(void) { return get_cpu_maps(); }
>>> +static inline void cpu_hotplug_done(void) { put_cpu_maps(); }
> Plus please switch to bool at the same time.

Yes, types like boot_t or u32 are getting rid of, so should Not be used.

Will be fixed.

>
> Jan
>
>
> .
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] xen: cpu: change 'cpu_hotplug_[begin|done]' to inline function
@ 2019-06-03  9:37       ` Julien Grall
  0 siblings, 0 replies; 18+ messages in thread
From: Julien Grall @ 2019-06-03  9:37 UTC (permalink / raw)
  To: chenbaodong, xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Jan Beulich

Hi,

On 03/06/2019 02:52, chenbaodong wrote:
> 
> On 5/31/19 18:55, Julien Grall wrote:
>> Hi,
>>
>> On 5/31/19 3:46 AM, Baodong Chen wrote:
>>> Signed-off-by: Baodong Chen <chenbaodong@mxnavi.com>
>>> ---
>>>   xen/common/cpu.c      | 10 ----------
>>>   xen/include/xen/cpu.h |  4 ++--
>>>   2 files changed, 2 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/xen/common/cpu.c b/xen/common/cpu.c
>>> index f388d89..a526b55 100644
>>> --- a/xen/common/cpu.c
>>> +++ b/xen/common/cpu.c
>>> @@ -51,16 +51,6 @@ void put_cpu_maps(void)
>>>       spin_unlock_recursive(&cpu_add_remove_lock);
>>>   }
>>>   -bool_t cpu_hotplug_begin(void)
>>> -{
>>> -    return get_cpu_maps();
>>> -}
>>> -
>>> -void cpu_hotplug_done(void)
>>> -{
>>> -    put_cpu_maps();
>>> -}
>>> -
>>>   static NOTIFIER_HEAD(cpu_chain);
>>>     void __init register_cpu_notifier(struct notifier_block *nb)
>>> diff --git a/xen/include/xen/cpu.h b/xen/include/xen/cpu.h
>>> index 4638c50..70a2df4 100644
>>> --- a/xen/include/xen/cpu.h
>>> +++ b/xen/include/xen/cpu.h
>>> @@ -10,8 +10,8 @@ bool_t get_cpu_maps(void);
>>>   void put_cpu_maps(void);
>>>     /* Safely perform CPU hotplug and update cpu_online_map, etc. */
>>> -bool_t cpu_hotplug_begin(void);
>>> -void cpu_hotplug_done(void);
>>> +static inline bool_t cpu_hotplug_begin(void) { return get_cpu_maps(); }
>>> +static inline void cpu_hotplug_done(void) { put_cpu_maps(); }
>>
>> The coding style should be:
>>
>> static inline....
>> {
>>       ...
>> }
>>
> Yes, clang-format automated format code for me, will be fixed.

Hmmm, clang-format does not have Xen coding style support yet. Do you have 
patches on top to handle it?

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xen-devel] [PATCH] xen: cpu: change 'cpu_hotplug_[begin|done]' to inline function
@ 2019-06-03  9:37       ` Julien Grall
  0 siblings, 0 replies; 18+ messages in thread
From: Julien Grall @ 2019-06-03  9:37 UTC (permalink / raw)
  To: chenbaodong, xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Jan Beulich

Hi,

On 03/06/2019 02:52, chenbaodong wrote:
> 
> On 5/31/19 18:55, Julien Grall wrote:
>> Hi,
>>
>> On 5/31/19 3:46 AM, Baodong Chen wrote:
>>> Signed-off-by: Baodong Chen <chenbaodong@mxnavi.com>
>>> ---
>>>   xen/common/cpu.c      | 10 ----------
>>>   xen/include/xen/cpu.h |  4 ++--
>>>   2 files changed, 2 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/xen/common/cpu.c b/xen/common/cpu.c
>>> index f388d89..a526b55 100644
>>> --- a/xen/common/cpu.c
>>> +++ b/xen/common/cpu.c
>>> @@ -51,16 +51,6 @@ void put_cpu_maps(void)
>>>       spin_unlock_recursive(&cpu_add_remove_lock);
>>>   }
>>>   -bool_t cpu_hotplug_begin(void)
>>> -{
>>> -    return get_cpu_maps();
>>> -}
>>> -
>>> -void cpu_hotplug_done(void)
>>> -{
>>> -    put_cpu_maps();
>>> -}
>>> -
>>>   static NOTIFIER_HEAD(cpu_chain);
>>>     void __init register_cpu_notifier(struct notifier_block *nb)
>>> diff --git a/xen/include/xen/cpu.h b/xen/include/xen/cpu.h
>>> index 4638c50..70a2df4 100644
>>> --- a/xen/include/xen/cpu.h
>>> +++ b/xen/include/xen/cpu.h
>>> @@ -10,8 +10,8 @@ bool_t get_cpu_maps(void);
>>>   void put_cpu_maps(void);
>>>     /* Safely perform CPU hotplug and update cpu_online_map, etc. */
>>> -bool_t cpu_hotplug_begin(void);
>>> -void cpu_hotplug_done(void);
>>> +static inline bool_t cpu_hotplug_begin(void) { return get_cpu_maps(); }
>>> +static inline void cpu_hotplug_done(void) { put_cpu_maps(); }
>>
>> The coding style should be:
>>
>> static inline....
>> {
>>       ...
>> }
>>
> Yes, clang-format automated format code for me, will be fixed.

Hmmm, clang-format does not have Xen coding style support yet. Do you have 
patches on top to handle it?

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] xen: cpu: change 'cpu_hotplug_[begin|done]' to inline function
@ 2019-06-03 10:22         ` chenbaodong
  0 siblings, 0 replies; 18+ messages in thread
From: chenbaodong @ 2019-06-03 10:22 UTC (permalink / raw)
  To: Julien Grall, xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Jan Beulich


On 6/3/19 17:37, Julien Grall wrote:
> Hi,
>
> On 03/06/2019 02:52, chenbaodong wrote:
>>
>> On 5/31/19 18:55, Julien Grall wrote:
>>> Hi,
>>>
>>> On 5/31/19 3:46 AM, Baodong Chen wrote:
>>>> Signed-off-by: Baodong Chen <chenbaodong@mxnavi.com>
>>>> ---
>>>>   xen/common/cpu.c      | 10 ----------
>>>>   xen/include/xen/cpu.h |  4 ++--
>>>>   2 files changed, 2 insertions(+), 12 deletions(-)
>>>>
>>>> diff --git a/xen/common/cpu.c b/xen/common/cpu.c
>>>> index f388d89..a526b55 100644
>>>> --- a/xen/common/cpu.c
>>>> +++ b/xen/common/cpu.c
>>>> @@ -51,16 +51,6 @@ void put_cpu_maps(void)
>>>>       spin_unlock_recursive(&cpu_add_remove_lock);
>>>>   }
>>>>   -bool_t cpu_hotplug_begin(void)
>>>> -{
>>>> -    return get_cpu_maps();
>>>> -}
>>>> -
>>>> -void cpu_hotplug_done(void)
>>>> -{
>>>> -    put_cpu_maps();
>>>> -}
>>>> -
>>>>   static NOTIFIER_HEAD(cpu_chain);
>>>>     void __init register_cpu_notifier(struct notifier_block *nb)
>>>> diff --git a/xen/include/xen/cpu.h b/xen/include/xen/cpu.h
>>>> index 4638c50..70a2df4 100644
>>>> --- a/xen/include/xen/cpu.h
>>>> +++ b/xen/include/xen/cpu.h
>>>> @@ -10,8 +10,8 @@ bool_t get_cpu_maps(void);
>>>>   void put_cpu_maps(void);
>>>>     /* Safely perform CPU hotplug and update cpu_online_map, etc. */
>>>> -bool_t cpu_hotplug_begin(void);
>>>> -void cpu_hotplug_done(void);
>>>> +static inline bool_t cpu_hotplug_begin(void) { return 
>>>> get_cpu_maps(); }
>>>> +static inline void cpu_hotplug_done(void) { put_cpu_maps(); }
>>>
>>> The coding style should be:
>>>
>>> static inline....
>>> {
>>>       ...
>>> }
>>>
>> Yes, clang-format automated format code for me, will be fixed.
>
> Hmmm, clang-format does not have Xen coding style support yet. Do you 
> have patches on top to handle it?

No, But the linux kernel seems already have it's clang-format support. 
Guess can used by xen.

IMO  i don't like the coding style in xen personally.

But it's code base has long years history. can insist on this or make 
some changes.

I prefer clang-format personally,  because no style issue in patch and 
will make review easier.

>
> Cheers,
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xen-devel] [PATCH] xen: cpu: change 'cpu_hotplug_[begin|done]' to inline function
@ 2019-06-03 10:22         ` chenbaodong
  0 siblings, 0 replies; 18+ messages in thread
From: chenbaodong @ 2019-06-03 10:22 UTC (permalink / raw)
  To: Julien Grall, xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Jan Beulich


On 6/3/19 17:37, Julien Grall wrote:
> Hi,
>
> On 03/06/2019 02:52, chenbaodong wrote:
>>
>> On 5/31/19 18:55, Julien Grall wrote:
>>> Hi,
>>>
>>> On 5/31/19 3:46 AM, Baodong Chen wrote:
>>>> Signed-off-by: Baodong Chen <chenbaodong@mxnavi.com>
>>>> ---
>>>>   xen/common/cpu.c      | 10 ----------
>>>>   xen/include/xen/cpu.h |  4 ++--
>>>>   2 files changed, 2 insertions(+), 12 deletions(-)
>>>>
>>>> diff --git a/xen/common/cpu.c b/xen/common/cpu.c
>>>> index f388d89..a526b55 100644
>>>> --- a/xen/common/cpu.c
>>>> +++ b/xen/common/cpu.c
>>>> @@ -51,16 +51,6 @@ void put_cpu_maps(void)
>>>>       spin_unlock_recursive(&cpu_add_remove_lock);
>>>>   }
>>>>   -bool_t cpu_hotplug_begin(void)
>>>> -{
>>>> -    return get_cpu_maps();
>>>> -}
>>>> -
>>>> -void cpu_hotplug_done(void)
>>>> -{
>>>> -    put_cpu_maps();
>>>> -}
>>>> -
>>>>   static NOTIFIER_HEAD(cpu_chain);
>>>>     void __init register_cpu_notifier(struct notifier_block *nb)
>>>> diff --git a/xen/include/xen/cpu.h b/xen/include/xen/cpu.h
>>>> index 4638c50..70a2df4 100644
>>>> --- a/xen/include/xen/cpu.h
>>>> +++ b/xen/include/xen/cpu.h
>>>> @@ -10,8 +10,8 @@ bool_t get_cpu_maps(void);
>>>>   void put_cpu_maps(void);
>>>>     /* Safely perform CPU hotplug and update cpu_online_map, etc. */
>>>> -bool_t cpu_hotplug_begin(void);
>>>> -void cpu_hotplug_done(void);
>>>> +static inline bool_t cpu_hotplug_begin(void) { return 
>>>> get_cpu_maps(); }
>>>> +static inline void cpu_hotplug_done(void) { put_cpu_maps(); }
>>>
>>> The coding style should be:
>>>
>>> static inline....
>>> {
>>>       ...
>>> }
>>>
>> Yes, clang-format automated format code for me, will be fixed.
>
> Hmmm, clang-format does not have Xen coding style support yet. Do you 
> have patches on top to handle it?

No, But the linux kernel seems already have it's clang-format support. 
Guess can used by xen.

IMO  i don't like the coding style in xen personally.

But it's code base has long years history. can insist on this or make 
some changes.

I prefer clang-format personally,  because no style issue in patch and 
will make review easier.

>
> Cheers,
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] xen: cpu: change 'cpu_hotplug_[begin|done]' to inline function
@ 2019-06-03 10:40           ` Julien Grall
  0 siblings, 0 replies; 18+ messages in thread
From: Julien Grall @ 2019-06-03 10:40 UTC (permalink / raw)
  To: chenbaodong, xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Jan Beulich

Hi,

On 03/06/2019 11:22, chenbaodong wrote:
> 
> On 6/3/19 17:37, Julien Grall wrote:
>> Hi,
>>
>> On 03/06/2019 02:52, chenbaodong wrote:
>>>
>>> On 5/31/19 18:55, Julien Grall wrote:
>>>> Hi,
>>>>
>>>> On 5/31/19 3:46 AM, Baodong Chen wrote:
>>>>> Signed-off-by: Baodong Chen <chenbaodong@mxnavi.com>
>>>>> ---
>>>>>   xen/common/cpu.c      | 10 ----------
>>>>>   xen/include/xen/cpu.h |  4 ++--
>>>>>   2 files changed, 2 insertions(+), 12 deletions(-)
>>>>>
>>>>> diff --git a/xen/common/cpu.c b/xen/common/cpu.c
>>>>> index f388d89..a526b55 100644
>>>>> --- a/xen/common/cpu.c
>>>>> +++ b/xen/common/cpu.c
>>>>> @@ -51,16 +51,6 @@ void put_cpu_maps(void)
>>>>>       spin_unlock_recursive(&cpu_add_remove_lock);
>>>>>   }
>>>>>   -bool_t cpu_hotplug_begin(void)
>>>>> -{
>>>>> -    return get_cpu_maps();
>>>>> -}
>>>>> -
>>>>> -void cpu_hotplug_done(void)
>>>>> -{
>>>>> -    put_cpu_maps();
>>>>> -}
>>>>> -
>>>>>   static NOTIFIER_HEAD(cpu_chain);
>>>>>     void __init register_cpu_notifier(struct notifier_block *nb)
>>>>> diff --git a/xen/include/xen/cpu.h b/xen/include/xen/cpu.h
>>>>> index 4638c50..70a2df4 100644
>>>>> --- a/xen/include/xen/cpu.h
>>>>> +++ b/xen/include/xen/cpu.h
>>>>> @@ -10,8 +10,8 @@ bool_t get_cpu_maps(void);
>>>>>   void put_cpu_maps(void);
>>>>>     /* Safely perform CPU hotplug and update cpu_online_map, etc. */
>>>>> -bool_t cpu_hotplug_begin(void);
>>>>> -void cpu_hotplug_done(void);
>>>>> +static inline bool_t cpu_hotplug_begin(void) { return get_cpu_maps(); }
>>>>> +static inline void cpu_hotplug_done(void) { put_cpu_maps(); }
>>>>
>>>> The coding style should be:
>>>>
>>>> static inline....
>>>> {
>>>>       ...
>>>> }
>>>>
>>> Yes, clang-format automated format code for me, will be fixed.
>>
>> Hmmm, clang-format does not have Xen coding style support yet. Do you have 
>> patches on top to handle it?
> 
> No, But the linux kernel seems already have it's clang-format support. Guess can 
> used by xen.

Most of Xen code base does not use Linux coding style. The only exception is 
file imported directly from Linux to ease porting bug fixes.

> 
> IMO  i don't like the coding style in xen personally.

I don't necessarily agree with all of it but some of the Linux style are odd too.

> 
> But it's code base has long years history. can insist on this or make some changes.

Improvement to the coding style are always welcomed. Although, you will notice 
that anything around coding style (in any project) is a matter of taste and can 
be difficult to find an agreement.

> 
> I prefer clang-format personally,  because no style issue in patch and will make 
> review easier.

clang-format is not a coding style. It is a tool helping to format in a specific 
coding style. There are effort to extend clang-format for supporting Xen coding 
style.

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xen-devel] [PATCH] xen: cpu: change 'cpu_hotplug_[begin|done]' to inline function
@ 2019-06-03 10:40           ` Julien Grall
  0 siblings, 0 replies; 18+ messages in thread
From: Julien Grall @ 2019-06-03 10:40 UTC (permalink / raw)
  To: chenbaodong, xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Jan Beulich

Hi,

On 03/06/2019 11:22, chenbaodong wrote:
> 
> On 6/3/19 17:37, Julien Grall wrote:
>> Hi,
>>
>> On 03/06/2019 02:52, chenbaodong wrote:
>>>
>>> On 5/31/19 18:55, Julien Grall wrote:
>>>> Hi,
>>>>
>>>> On 5/31/19 3:46 AM, Baodong Chen wrote:
>>>>> Signed-off-by: Baodong Chen <chenbaodong@mxnavi.com>
>>>>> ---
>>>>>   xen/common/cpu.c      | 10 ----------
>>>>>   xen/include/xen/cpu.h |  4 ++--
>>>>>   2 files changed, 2 insertions(+), 12 deletions(-)
>>>>>
>>>>> diff --git a/xen/common/cpu.c b/xen/common/cpu.c
>>>>> index f388d89..a526b55 100644
>>>>> --- a/xen/common/cpu.c
>>>>> +++ b/xen/common/cpu.c
>>>>> @@ -51,16 +51,6 @@ void put_cpu_maps(void)
>>>>>       spin_unlock_recursive(&cpu_add_remove_lock);
>>>>>   }
>>>>>   -bool_t cpu_hotplug_begin(void)
>>>>> -{
>>>>> -    return get_cpu_maps();
>>>>> -}
>>>>> -
>>>>> -void cpu_hotplug_done(void)
>>>>> -{
>>>>> -    put_cpu_maps();
>>>>> -}
>>>>> -
>>>>>   static NOTIFIER_HEAD(cpu_chain);
>>>>>     void __init register_cpu_notifier(struct notifier_block *nb)
>>>>> diff --git a/xen/include/xen/cpu.h b/xen/include/xen/cpu.h
>>>>> index 4638c50..70a2df4 100644
>>>>> --- a/xen/include/xen/cpu.h
>>>>> +++ b/xen/include/xen/cpu.h
>>>>> @@ -10,8 +10,8 @@ bool_t get_cpu_maps(void);
>>>>>   void put_cpu_maps(void);
>>>>>     /* Safely perform CPU hotplug and update cpu_online_map, etc. */
>>>>> -bool_t cpu_hotplug_begin(void);
>>>>> -void cpu_hotplug_done(void);
>>>>> +static inline bool_t cpu_hotplug_begin(void) { return get_cpu_maps(); }
>>>>> +static inline void cpu_hotplug_done(void) { put_cpu_maps(); }
>>>>
>>>> The coding style should be:
>>>>
>>>> static inline....
>>>> {
>>>>       ...
>>>> }
>>>>
>>> Yes, clang-format automated format code for me, will be fixed.
>>
>> Hmmm, clang-format does not have Xen coding style support yet. Do you have 
>> patches on top to handle it?
> 
> No, But the linux kernel seems already have it's clang-format support. Guess can 
> used by xen.

Most of Xen code base does not use Linux coding style. The only exception is 
file imported directly from Linux to ease porting bug fixes.

> 
> IMO  i don't like the coding style in xen personally.

I don't necessarily agree with all of it but some of the Linux style are odd too.

> 
> But it's code base has long years history. can insist on this or make some changes.

Improvement to the coding style are always welcomed. Although, you will notice 
that anything around coding style (in any project) is a matter of taste and can 
be difficult to find an agreement.

> 
> I prefer clang-format personally,  because no style issue in patch and will make 
> review easier.

clang-format is not a coding style. It is a tool helping to format in a specific 
coding style. There are effort to extend clang-format for supporting Xen coding 
style.

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] xen: cpu: change 'cpu_hotplug_[begin|done]' to inline function
@ 2019-06-03 11:00             ` chenbaodong
  0 siblings, 0 replies; 18+ messages in thread
From: chenbaodong @ 2019-06-03 11:00 UTC (permalink / raw)
  To: Julien Grall, xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Jan Beulich


On 6/3/19 18:40, Julien Grall wrote:
> Hi,
>
> On 03/06/2019 11:22, chenbaodong wrote:
>>
>> On 6/3/19 17:37, Julien Grall wrote:
>>> Hi,
>>>
>>> On 03/06/2019 02:52, chenbaodong wrote:
>>>>
>>>> On 5/31/19 18:55, Julien Grall wrote:
>>>>> Hi,
>>>>>
>>>>> On 5/31/19 3:46 AM, Baodong Chen wrote:
>>>>>> Signed-off-by: Baodong Chen <chenbaodong@mxnavi.com>
>>>>>> ---
>>>>>>   xen/common/cpu.c      | 10 ----------
>>>>>>   xen/include/xen/cpu.h |  4 ++--
>>>>>>   2 files changed, 2 insertions(+), 12 deletions(-)
>>>>>>
>>>>>> diff --git a/xen/common/cpu.c b/xen/common/cpu.c
>>>>>> index f388d89..a526b55 100644
>>>>>> --- a/xen/common/cpu.c
>>>>>> +++ b/xen/common/cpu.c
>>>>>> @@ -51,16 +51,6 @@ void put_cpu_maps(void)
>>>>>>       spin_unlock_recursive(&cpu_add_remove_lock);
>>>>>>   }
>>>>>>   -bool_t cpu_hotplug_begin(void)
>>>>>> -{
>>>>>> -    return get_cpu_maps();
>>>>>> -}
>>>>>> -
>>>>>> -void cpu_hotplug_done(void)
>>>>>> -{
>>>>>> -    put_cpu_maps();
>>>>>> -}
>>>>>> -
>>>>>>   static NOTIFIER_HEAD(cpu_chain);
>>>>>>     void __init register_cpu_notifier(struct notifier_block *nb)
>>>>>> diff --git a/xen/include/xen/cpu.h b/xen/include/xen/cpu.h
>>>>>> index 4638c50..70a2df4 100644
>>>>>> --- a/xen/include/xen/cpu.h
>>>>>> +++ b/xen/include/xen/cpu.h
>>>>>> @@ -10,8 +10,8 @@ bool_t get_cpu_maps(void);
>>>>>>   void put_cpu_maps(void);
>>>>>>     /* Safely perform CPU hotplug and update cpu_online_map, etc. */
>>>>>> -bool_t cpu_hotplug_begin(void);
>>>>>> -void cpu_hotplug_done(void);
>>>>>> +static inline bool_t cpu_hotplug_begin(void) { return 
>>>>>> get_cpu_maps(); }
>>>>>> +static inline void cpu_hotplug_done(void) { put_cpu_maps(); }
>>>>>
>>>>> The coding style should be:
>>>>>
>>>>> static inline....
>>>>> {
>>>>>       ...
>>>>> }
>>>>>
>>>> Yes, clang-format automated format code for me, will be fixed.
>>>
>>> Hmmm, clang-format does not have Xen coding style support yet. Do 
>>> you have patches on top to handle it?
>>
>> No, But the linux kernel seems already have it's clang-format 
>> support. Guess can used by xen.
>
> Most of Xen code base does not use Linux coding style. The only 
> exception is file imported directly from Linux to ease porting bug fixes.

Roger that.


>
>>
>> IMO  i don't like the coding style in xen personally.
>
> I don't necessarily agree with all of it but some of the Linux style 
> are odd too.
yes yes,  Linux style, eg: 'tab', i also dislike.
>
>>
>> But it's code base has long years history. can insist on this or make 
>> some changes.
>
> Improvement to the coding style are always welcomed. Although, you 
> will notice that anything around coding style (in any project) is a 
> matter of taste and can be difficult to find an agreement.

Agree.

>
>>
>> I prefer clang-format personally,  because no style issue in patch 
>> and will make review easier.
>
> clang-format is not a coding style. It is a tool helping to format in 
> a specific coding style. There are effort to extend clang-format for 
> supporting Xen coding style.

Agree, For xen, it's worth to have it's '.clang-format' file according 
to it's style.

>
> Cheers,
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xen-devel] [PATCH] xen: cpu: change 'cpu_hotplug_[begin|done]' to inline function
@ 2019-06-03 11:00             ` chenbaodong
  0 siblings, 0 replies; 18+ messages in thread
From: chenbaodong @ 2019-06-03 11:00 UTC (permalink / raw)
  To: Julien Grall, xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Jan Beulich


On 6/3/19 18:40, Julien Grall wrote:
> Hi,
>
> On 03/06/2019 11:22, chenbaodong wrote:
>>
>> On 6/3/19 17:37, Julien Grall wrote:
>>> Hi,
>>>
>>> On 03/06/2019 02:52, chenbaodong wrote:
>>>>
>>>> On 5/31/19 18:55, Julien Grall wrote:
>>>>> Hi,
>>>>>
>>>>> On 5/31/19 3:46 AM, Baodong Chen wrote:
>>>>>> Signed-off-by: Baodong Chen <chenbaodong@mxnavi.com>
>>>>>> ---
>>>>>>   xen/common/cpu.c      | 10 ----------
>>>>>>   xen/include/xen/cpu.h |  4 ++--
>>>>>>   2 files changed, 2 insertions(+), 12 deletions(-)
>>>>>>
>>>>>> diff --git a/xen/common/cpu.c b/xen/common/cpu.c
>>>>>> index f388d89..a526b55 100644
>>>>>> --- a/xen/common/cpu.c
>>>>>> +++ b/xen/common/cpu.c
>>>>>> @@ -51,16 +51,6 @@ void put_cpu_maps(void)
>>>>>>       spin_unlock_recursive(&cpu_add_remove_lock);
>>>>>>   }
>>>>>>   -bool_t cpu_hotplug_begin(void)
>>>>>> -{
>>>>>> -    return get_cpu_maps();
>>>>>> -}
>>>>>> -
>>>>>> -void cpu_hotplug_done(void)
>>>>>> -{
>>>>>> -    put_cpu_maps();
>>>>>> -}
>>>>>> -
>>>>>>   static NOTIFIER_HEAD(cpu_chain);
>>>>>>     void __init register_cpu_notifier(struct notifier_block *nb)
>>>>>> diff --git a/xen/include/xen/cpu.h b/xen/include/xen/cpu.h
>>>>>> index 4638c50..70a2df4 100644
>>>>>> --- a/xen/include/xen/cpu.h
>>>>>> +++ b/xen/include/xen/cpu.h
>>>>>> @@ -10,8 +10,8 @@ bool_t get_cpu_maps(void);
>>>>>>   void put_cpu_maps(void);
>>>>>>     /* Safely perform CPU hotplug and update cpu_online_map, etc. */
>>>>>> -bool_t cpu_hotplug_begin(void);
>>>>>> -void cpu_hotplug_done(void);
>>>>>> +static inline bool_t cpu_hotplug_begin(void) { return 
>>>>>> get_cpu_maps(); }
>>>>>> +static inline void cpu_hotplug_done(void) { put_cpu_maps(); }
>>>>>
>>>>> The coding style should be:
>>>>>
>>>>> static inline....
>>>>> {
>>>>>       ...
>>>>> }
>>>>>
>>>> Yes, clang-format automated format code for me, will be fixed.
>>>
>>> Hmmm, clang-format does not have Xen coding style support yet. Do 
>>> you have patches on top to handle it?
>>
>> No, But the linux kernel seems already have it's clang-format 
>> support. Guess can used by xen.
>
> Most of Xen code base does not use Linux coding style. The only 
> exception is file imported directly from Linux to ease porting bug fixes.

Roger that.


>
>>
>> IMO  i don't like the coding style in xen personally.
>
> I don't necessarily agree with all of it but some of the Linux style 
> are odd too.
yes yes,  Linux style, eg: 'tab', i also dislike.
>
>>
>> But it's code base has long years history. can insist on this or make 
>> some changes.
>
> Improvement to the coding style are always welcomed. Although, you 
> will notice that anything around coding style (in any project) is a 
> matter of taste and can be difficult to find an agreement.

Agree.

>
>>
>> I prefer clang-format personally,  because no style issue in patch 
>> and will make review easier.
>
> clang-format is not a coding style. It is a tool helping to format in 
> a specific coding style. There are effort to extend clang-format for 
> supporting Xen coding style.

Agree, For xen, it's worth to have it's '.clang-format' file according 
to it's style.

>
> Cheers,
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2019-06-03 11:00 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-31  2:46 [PATCH] xen: cpu: change 'cpu_hotplug_[begin|done]' to inline function Baodong Chen
2019-05-31  2:46 ` [Xen-devel] " Baodong Chen
2019-05-31 10:55 ` Julien Grall
2019-05-31 10:55   ` [Xen-devel] " Julien Grall
2019-05-31 11:30   ` Jan Beulich
2019-05-31 11:30     ` [Xen-devel] " Jan Beulich
2019-06-03  1:56     ` chenbaodong
2019-06-03  1:56       ` [Xen-devel] " chenbaodong
2019-06-03  1:52   ` chenbaodong
2019-06-03  1:52     ` [Xen-devel] " chenbaodong
2019-06-03  9:37     ` Julien Grall
2019-06-03  9:37       ` [Xen-devel] " Julien Grall
2019-06-03 10:22       ` chenbaodong
2019-06-03 10:22         ` [Xen-devel] " chenbaodong
2019-06-03 10:40         ` Julien Grall
2019-06-03 10:40           ` [Xen-devel] " Julien Grall
2019-06-03 11:00           ` chenbaodong
2019-06-03 11:00             ` [Xen-devel] " chenbaodong

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.