Skip to contentSkip to conversation

common/sched: Correct function prototypes

PATCH In review Andrew Cooper 5 participants 8 messages Oct 10, 2013 – Oct 11, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common/sched: Correct function prototypes

struct vcpu pointers are traditionally v rather than d.

CC Keir Fraser <[email protected]>
CC Jan Beulich <[email protected]>

George Dunlap <[email protected]>

---
 xen/include/xen/sched.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
xen/include/xen/sched.h +3 -3
index 1765e18..2e83f08 100644
@@ -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,
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Andrew Cooper

struct vcpu pointers are traditionally v rather than d.

CC Keir Fraser <[email protected]>
CC Jan Beulich <[email protected]>

George Dunlap <[email protected]>

Quoted 23 lines
---
 xen/include/xen/sched.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
xen/include/xen/sched.h +3 -3
index 1765e18..2e83f08 100644
@@ -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,

#2 lore raw
Quoted 11 lines
Quoted 1 line
Quoted 1 line · Keir Fraser
Quoted 6 lines · Andrew Cooper

struct vcpu pointers are traditionally v rather than d.

CC Keir Fraser <[email protected]>
CC Jan Beulich <[email protected]>

George Dunlap <[email protected]>

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

Quoted 4 lines
Quoted 4 lines
xen/include/xen/sched.h +0 -0
@@ -567,9 +567,9 @@ void sched_set_node_affinity(struct domain *, nodemask_t *);
 int  sched_id(void);
Quoted 8 lines

xen/include/xen/sched.h void sched_set_node_affinity(struct domain *, nodemask_t *); · line 572

Quoted 8 lines
xen/include/xen/sched.h +3 -3
 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

#3 lore raw
Quoted 14 lines · Jan Beulich
Quoted 11 lines
Quoted 1 line
Quoted 1 line · Keir Fraser
Quoted 6 lines · Andrew Cooper

struct vcpu pointers are traditionally v rather than d.

CC Keir Fraser <[email protected]>
CC Jan Beulich <[email protected]>

George Dunlap <[email protected]>

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

Quoted 15 lines
Quoted 4 lines
Quoted 4 lines
xen/include/xen/sched.h +0 -0
@@ -567,9 +567,9 @@ void sched_set_node_affinity(struct domain *, nodemask_t *);
 int  sched_id(void);
Quoted 8 lines

xen/include/xen/sched.h void sched_set_node_affinity(struct domain *, nodemask_t *); · line 572

Quoted 8 lines
xen/include/xen/sched.h +3 -3
 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.

#4 lore raw
Quoted 20 lines
Quoted 1 line
Quoted 1 line · Tim Deegan
Quoted 17 lines · Jan Beulich
Quoted 14 lines
Quoted 1 line
Quoted 1 line · Keir Fraser

xen/include/xen/sched.h void sched_set_node_affinity(struct domain *, nodemask_t *); · line 572

Quoted 12 lines · Andrew Cooper
xen/include/xen/sched.h +3 -3
@@ -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.

Quoted 1 line

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

Any specific reason for that?

Jan

#5 lore raw
Quoted 20 lines · Jan Beulich
Quoted 20 lines
Quoted 1 line
Quoted 1 line · Tim Deegan
Quoted 17 lines · Jan Beulich
Quoted 14 lines
Quoted 1 line
Quoted 1 line · Keir Fraser

xen/include/xen/sched.h void sched_set_node_affinity(struct domain *, nodemask_t *); · line 572

Quoted 12 lines · Andrew Cooper
xen/include/xen/sched.h +3 -3
@@ -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.

Quoted 3 lines
Quoted 1 line

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.

#6 lore raw
Quoted 5 lines · Tim Deegan
Quoted 5 lines
Quoted 4 lines
Quoted 2 lines

... 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.

Quoted 8 lines
Quoted 1 line

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

#7 lore raw
In reply to Tim Deegan
Quoted 23 lines · Tim Deegan
Quoted 22 lines · Jan Beulich
Quoted 21 lines
Quoted 1 line
Quoted 1 line · Tim Deegan
Quoted 17 lines · Jan Beulich
Quoted 14 lines
Quoted 1 line
Quoted 1 line · Keir Fraser

xen/include/xen/sched.h void sched_set_node_affinity(struct domain *, nodemask_t *); · line 572

Quoted 12 lines · Andrew Cooper
xen/include/xen/sched.h +3 -3
@@ -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.

Quoted 8 lines
Quoted 1 line

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