xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] common/sched: Correct function prototypes
@ 2013-10-10 17:05 Andrew Cooper
  2013-10-10 18:25 ` Keir Fraser
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Cooper @ 2013-10-10 17:05 UTC (permalink / raw)
  To: Xen-devel; +Cc: Andrew Cooper, Keir Fraser, Jan Beulich

struct vcpu pointers are traditionally v rather than d.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Keir Fraser <keir@xen.org>
CC: Jan Beulich <JBeulich@suse.com>
George Dunlap <george.dunlap@eu.citrix.com>
---
 xen/include/xen/sched.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 1765e18..2e83f08 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -567,9 +567,9 @@ void sched_set_node_affinity(struct domain *, nodemask_t *);
 int  sched_id(void);
 void sched_tick_suspend(void);
 void sched_tick_resume(void);
-void vcpu_wake(struct vcpu *d);
-void vcpu_sleep_nosync(struct vcpu *d);
-void vcpu_sleep_sync(struct vcpu *d);
+void vcpu_wake(struct vcpu *v);
+void vcpu_sleep_nosync(struct vcpu *v);
+void vcpu_sleep_sync(struct vcpu *v);
 
 /*
  * Force synchronisation of given VCPU's state. If it is currently descheduled,
-- 
1.7.10.4

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

* Re: [PATCH] common/sched: Correct function prototypes
  2013-10-10 17:05 [PATCH] common/sched: Correct function prototypes Andrew Cooper
@ 2013-10-10 18:25 ` Keir Fraser
  2013-10-11  6:55   ` Jan Beulich
  0 siblings, 1 reply; 8+ messages in thread
From: Keir Fraser @ 2013-10-10 18:25 UTC (permalink / raw)
  To: Andrew Cooper, Xen-devel; +Cc: Jan Beulich

On 10/10/2013 18:05, "Andrew Cooper" <andrew.cooper3@citrix.com> wrote:

> struct vcpu pointers are traditionally v rather than d.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> CC: Keir Fraser <keir@xen.org>
> CC: Jan Beulich <JBeulich@suse.com>
> George Dunlap <george.dunlap@eu.citrix.com>

Acked-by: Keir Fraser <keir@xen.org>

> ---
>  xen/include/xen/sched.h |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
> index 1765e18..2e83f08 100644
> --- a/xen/include/xen/sched.h
> +++ b/xen/include/xen/sched.h
> @@ -567,9 +567,9 @@ void sched_set_node_affinity(struct domain *, nodemask_t
> *);
>  int  sched_id(void);
>  void sched_tick_suspend(void);
>  void sched_tick_resume(void);
> -void vcpu_wake(struct vcpu *d);
> -void vcpu_sleep_nosync(struct vcpu *d);
> -void vcpu_sleep_sync(struct vcpu *d);
> +void vcpu_wake(struct vcpu *v);
> +void vcpu_sleep_nosync(struct vcpu *v);
> +void vcpu_sleep_sync(struct vcpu *v);
>  
>  /*
>   * Force synchronisation of given VCPU's state. If it is currently
> descheduled,

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

* Re: [PATCH] common/sched: Correct function prototypes
  2013-10-10 18:25 ` Keir Fraser
@ 2013-10-11  6:55   ` Jan Beulich
  2013-10-11  9:40     ` Tim Deegan
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Beulich @ 2013-10-11  6:55 UTC (permalink / raw)
  To: Andrew Cooper, Keir Fraser; +Cc: xen-devel

>>> On 10.10.13 at 20:25, Keir Fraser <keir.xen@gmail.com> wrote:
> On 10/10/2013 18:05, "Andrew Cooper" <andrew.cooper3@citrix.com> wrote:
> 
>> struct vcpu pointers are traditionally v rather than d.
>> 
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> CC: Keir Fraser <keir@xen.org>
>> CC: Jan Beulich <JBeulich@suse.com>
>> George Dunlap <george.dunlap@eu.citrix.com>
> 
> Acked-by: Keir Fraser <keir@xen.org>

I'll commit it as is, but ...

>> --- a/xen/include/xen/sched.h
>> +++ b/xen/include/xen/sched.h
>> @@ -567,9 +567,9 @@ void sched_set_node_affinity(struct domain *, nodemask_t *);
>>  int  sched_id(void);
>>  void sched_tick_suspend(void);
>>  void sched_tick_resume(void);
>> -void vcpu_wake(struct vcpu *d);
>> -void vcpu_sleep_nosync(struct vcpu *d);
>> -void vcpu_sleep_sync(struct vcpu *d);
>> +void vcpu_wake(struct vcpu *v);
>> +void vcpu_sleep_nosync(struct vcpu *v);
>> +void vcpu_sleep_sync(struct vcpu *v);

... I'd much prefer if we stopped naming parameters in declarations
where the parameter types are already sufficiently describing them.
You may have noted that for quite some time patches of mine have
already been doing that (and a trace of this can even be seen in the
patch hunk header above). I would even suggest adding a
respective statement to the coding style document.

Jan

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

* Re: [PATCH] common/sched: Correct function prototypes
  2013-10-11  6:55   ` Jan Beulich
@ 2013-10-11  9:40     ` Tim Deegan
  2013-10-11 11:49       ` Jan Beulich
  0 siblings, 1 reply; 8+ messages in thread
From: Tim Deegan @ 2013-10-11  9:40 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Andrew Cooper, Keir Fraser, xen-devel

At 07:55 +0100 on 11 Oct (1381478143), Jan Beulich wrote:
> >>> On 10.10.13 at 20:25, Keir Fraser <keir.xen@gmail.com> wrote:
> > On 10/10/2013 18:05, "Andrew Cooper" <andrew.cooper3@citrix.com> wrote:
> > 
> >> struct vcpu pointers are traditionally v rather than d.
> >> 
> >> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> >> CC: Keir Fraser <keir@xen.org>
> >> CC: Jan Beulich <JBeulich@suse.com>
> >> George Dunlap <george.dunlap@eu.citrix.com>
> > 
> > Acked-by: Keir Fraser <keir@xen.org>
> 
> I'll commit it as is, but ...
> 
> >> --- a/xen/include/xen/sched.h
> >> +++ b/xen/include/xen/sched.h
> >> @@ -567,9 +567,9 @@ void sched_set_node_affinity(struct domain *, nodemask_t *);
> >>  int  sched_id(void);
> >>  void sched_tick_suspend(void);
> >>  void sched_tick_resume(void);
> >> -void vcpu_wake(struct vcpu *d);
> >> -void vcpu_sleep_nosync(struct vcpu *d);
> >> -void vcpu_sleep_sync(struct vcpu *d);
> >> +void vcpu_wake(struct vcpu *v);
> >> +void vcpu_sleep_nosync(struct vcpu *v);
> >> +void vcpu_sleep_sync(struct vcpu *v);
> 
> ... I'd much prefer if we stopped naming parameters in declarations
> where the parameter types are already sufficiently describing them.

I'd rather not -- I prefer the declarations to match the definitions.

Tim.

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

* Re: [PATCH] common/sched: Correct function prototypes
  2013-10-11  9:40     ` Tim Deegan
@ 2013-10-11 11:49       ` Jan Beulich
  2013-10-11 12:06         ` Tim Deegan
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Beulich @ 2013-10-11 11:49 UTC (permalink / raw)
  To: Tim Deegan; +Cc: Andrew Cooper, Keir Fraser, xen-devel

>>> On 11.10.13 at 11:40, Tim Deegan <tim@xen.org> wrote:
> At 07:55 +0100 on 11 Oct (1381478143), Jan Beulich wrote:
>> >>> On 10.10.13 at 20:25, Keir Fraser <keir.xen@gmail.com> wrote:
>> > On 10/10/2013 18:05, "Andrew Cooper" <andrew.cooper3@citrix.com> wrote:
>> >> --- a/xen/include/xen/sched.h
>> >> +++ b/xen/include/xen/sched.h
>> >> @@ -567,9 +567,9 @@ void sched_set_node_affinity(struct domain *, nodemask_t *);
>> >>  int  sched_id(void);
>> >>  void sched_tick_suspend(void);
>> >>  void sched_tick_resume(void);
>> >> -void vcpu_wake(struct vcpu *d);
>> >> -void vcpu_sleep_nosync(struct vcpu *d);
>> >> -void vcpu_sleep_sync(struct vcpu *d);
>> >> +void vcpu_wake(struct vcpu *v);
>> >> +void vcpu_sleep_nosync(struct vcpu *v);
>> >> +void vcpu_sleep_sync(struct vcpu *v);
>> 
>> ... I'd much prefer if we stopped naming parameters in declarations
>> where the parameter types are already sufficiently describing them.
> 
> I'd rather not -- I prefer the declarations to match the definitions.

Any specific reason for that?

Jan

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

* Re: [PATCH] common/sched: Correct function prototypes
  2013-10-11 11:49       ` Jan Beulich
@ 2013-10-11 12:06         ` Tim Deegan
  2013-10-11 13:54           ` Keir Fraser
  2013-10-11 14:47           ` George Dunlap
  0 siblings, 2 replies; 8+ messages in thread
From: Tim Deegan @ 2013-10-11 12:06 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Andrew Cooper, Keir Fraser, xen-devel

At 12:49 +0100 on 11 Oct (1381495754), Jan Beulich wrote:
> >>> On 11.10.13 at 11:40, Tim Deegan <tim@xen.org> wrote:
> > At 07:55 +0100 on 11 Oct (1381478143), Jan Beulich wrote:
> >> >>> On 10.10.13 at 20:25, Keir Fraser <keir.xen@gmail.com> wrote:
> >> > On 10/10/2013 18:05, "Andrew Cooper" <andrew.cooper3@citrix.com> wrote:
> >> >> --- a/xen/include/xen/sched.h
> >> >> +++ b/xen/include/xen/sched.h
> >> >> @@ -567,9 +567,9 @@ void sched_set_node_affinity(struct domain *, nodemask_t *);
> >> >>  int  sched_id(void);
> >> >>  void sched_tick_suspend(void);
> >> >>  void sched_tick_resume(void);
> >> >> -void vcpu_wake(struct vcpu *d);
> >> >> -void vcpu_sleep_nosync(struct vcpu *d);
> >> >> -void vcpu_sleep_sync(struct vcpu *d);
> >> >> +void vcpu_wake(struct vcpu *v);
> >> >> +void vcpu_sleep_nosync(struct vcpu *v);
> >> >> +void vcpu_sleep_sync(struct vcpu *v);
> >> 
> >> ... I'd much prefer if we stopped naming parameters in declarations
> >> where the parameter types are already sufficiently describing them.
> > 
> > I'd rather not -- I prefer the declarations to match the definitions.
> 
> Any specific reason for that?

Nothing very strong -- I just find it easier to read, and more
consistent (since we do need to keep the names of _some_ arguments).

I know there are lots of type-only declarations in the tree already, and
I'm not suggesting we get rid of them, but I wouldn't like to see it
become the prescribed coding style.

Cheers,

Tim.

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

* Re: [PATCH] common/sched: Correct function prototypes
  2013-10-11 12:06         ` Tim Deegan
@ 2013-10-11 13:54           ` Keir Fraser
  2013-10-11 14:47           ` George Dunlap
  1 sibling, 0 replies; 8+ messages in thread
From: Keir Fraser @ 2013-10-11 13:54 UTC (permalink / raw)
  To: Tim Deegan, Jan Beulich; +Cc: Andrew Cooper, xen-devel

On 11/10/2013 13:06, "Tim Deegan" <tim@xen.org> wrote:

>>>> ... I'd much prefer if we stopped naming parameters in declarations
>>>> where the parameter types are already sufficiently describing them.
>>> 
>>> I'd rather not -- I prefer the declarations to match the definitions.
>> 
>> Any specific reason for that?
> 
> Nothing very strong -- I just find it easier to read, and more
> consistent (since we do need to keep the names of _some_ arguments).
> 
> I know there are lots of type-only declarations in the tree already, and
> I'm not suggesting we get rid of them, but I wouldn't like to see it
> become the prescribed coding style.

I agree with this.

 -- Keir

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

* Re: [PATCH] common/sched: Correct function prototypes
  2013-10-11 12:06         ` Tim Deegan
  2013-10-11 13:54           ` Keir Fraser
@ 2013-10-11 14:47           ` George Dunlap
  1 sibling, 0 replies; 8+ messages in thread
From: George Dunlap @ 2013-10-11 14:47 UTC (permalink / raw)
  To: Tim Deegan; +Cc: Andrew Cooper, Keir Fraser, Jan Beulich, xen-devel

On Fri, Oct 11, 2013 at 1:06 PM, Tim Deegan <tim@xen.org> wrote:
> At 12:49 +0100 on 11 Oct (1381495754), Jan Beulich wrote:
>> >>> On 11.10.13 at 11:40, Tim Deegan <tim@xen.org> wrote:
>> > At 07:55 +0100 on 11 Oct (1381478143), Jan Beulich wrote:
>> >> >>> On 10.10.13 at 20:25, Keir Fraser <keir.xen@gmail.com> wrote:
>> >> > On 10/10/2013 18:05, "Andrew Cooper" <andrew.cooper3@citrix.com> wrote:
>> >> >> --- a/xen/include/xen/sched.h
>> >> >> +++ b/xen/include/xen/sched.h
>> >> >> @@ -567,9 +567,9 @@ void sched_set_node_affinity(struct domain *, nodemask_t *);
>> >> >>  int  sched_id(void);
>> >> >>  void sched_tick_suspend(void);
>> >> >>  void sched_tick_resume(void);
>> >> >> -void vcpu_wake(struct vcpu *d);
>> >> >> -void vcpu_sleep_nosync(struct vcpu *d);
>> >> >> -void vcpu_sleep_sync(struct vcpu *d);
>> >> >> +void vcpu_wake(struct vcpu *v);
>> >> >> +void vcpu_sleep_nosync(struct vcpu *v);
>> >> >> +void vcpu_sleep_sync(struct vcpu *v);
>> >>
>> >> ... I'd much prefer if we stopped naming parameters in declarations
>> >> where the parameter types are already sufficiently describing them.
>> >
>> > I'd rather not -- I prefer the declarations to match the definitions.
>>
>> Any specific reason for that?
>
> Nothing very strong -- I just find it easier to read, and more
> consistent (since we do need to keep the names of _some_ arguments).
>
> I know there are lots of type-only declarations in the tree already, and
> I'm not suggesting we get rid of them, but I wouldn't like to see it
> become the prescribed coding style.

+1

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

end of thread, other threads:[~2013-10-11 14:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-10 17:05 [PATCH] common/sched: Correct function prototypes Andrew Cooper
2013-10-10 18:25 ` Keir Fraser
2013-10-11  6:55   ` Jan Beulich
2013-10-11  9:40     ` Tim Deegan
2013-10-11 11:49       ` Jan Beulich
2013-10-11 12:06         ` Tim Deegan
2013-10-11 13:54           ` Keir Fraser
2013-10-11 14:47           ` George Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).