Skip to contentSkip to conversation

xen: tmem: rmove useless parameters

PATCH In review Bob Liu 3 participants 7 messages Nov 20, 2013 Xen hypervisor interface

lore
Share & tools
lore

Bob Liu

author
#0 lore raw

PATCH 1/1 xen: tmem: rmove useless parameters

tmem only takes a page as unit, so parameters tmem_offset, pfn_offset and len are meanless, this patch remove those always 0 parameters.

---
 drivers/xen/tmem.c |   18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)
drivers/xen/tmem.c +6 -12
index 83b5c53..9fd0fdc 100644
@@ -89,7 +89,7 @@ struct tmem_oid {
 /* xen tmem foundation ops/hypercalls */
 
 static inline int xen_tmem_op(u32 tmem_cmd, u32 tmem_pool, struct tmem_oid oid,
-	u32 index, unsigned long gmfn, u32 tmem_offset, u32 pfn_offset, u32 len)
+		u32 index, unsigned long gmfn)
 {
 	struct tmem_op op;
 	int rc = 0;
@@ -100,9 +100,6 @@ static inline int xen_tmem_op(u32 tmem_cmd, u32 tmem_pool, struct tmem_oid oid,
 	op.u.gen.oid[1] = oid.oid[1];
 	op.u.gen.oid[2] = oid.oid[2];
 	op.u.gen.index = index;
-	op.u.gen.tmem_offset = tmem_offset;
-	op.u.gen.pfn_offset = pfn_offset;
-	op.u.gen.len = len;
 	set_xen_guest_handle(op.u.gen.gmfn, (void *)gmfn);
 	rc = HYPERVISOR_tmem_op(&op);
 	return rc;
@@ -133,8 +130,7 @@ static int xen_tmem_put_page(u32 pool_id, struct tmem_oid oid,
 {
 	unsigned long gmfn = xen_pv_domain() ? pfn_to_mfn(pfn) : pfn;
 
-	return xen_tmem_op(TMEM_PUT_PAGE, pool_id, oid, index,
-		gmfn, 0, 0, 0);
+	return xen_tmem_op(TMEM_PUT_PAGE, pool_id, oid, index, gmfn);
 }
 
 static int xen_tmem_get_page(u32 pool_id, struct tmem_oid oid,
@@ -142,19 +138,17 @@ static int xen_tmem_get_page(u32 pool_id, struct tmem_oid oid,
 {
 	unsigned long gmfn = xen_pv_domain() ? pfn_to_mfn(pfn) : pfn;
 
-	return xen_tmem_op(TMEM_GET_PAGE, pool_id, oid, index,
-		gmfn, 0, 0, 0);
+	return xen_tmem_op(TMEM_GET_PAGE, pool_id, oid, index, gmfn);
 }
 
 static int xen_tmem_flush_page(u32 pool_id, struct tmem_oid oid, u32 index)
 {
-	return xen_tmem_op(TMEM_FLUSH_PAGE, pool_id, oid, index,
-		0, 0, 0, 0);
+	return xen_tmem_op(TMEM_FLUSH_PAGE, pool_id, oid, index, 0);
 }
 
 static int xen_tmem_flush_object(u32 pool_id, struct tmem_oid oid)
 {
-	return xen_tmem_op(TMEM_FLUSH_OBJECT, pool_id, oid, 0, 0, 0, 0, 0);
+	return xen_tmem_op(TMEM_FLUSH_OBJECT, pool_id, oid, 0, 0);
 }
 
 
@@ -163,7 +157,7 @@ static int xen_tmem_destroy_pool(u32 pool_id)
 {
 	struct tmem_oid oid = { { 0 } };
 
-	return xen_tmem_op(TMEM_DESTROY_POOL, pool_id, oid, 0, 0, 0, 0, 0);
+	return xen_tmem_op(TMEM_DESTROY_POOL, pool_id, oid, 0, 0);
 }
 
 /* cleancache ops */
Signature · 1 line
1.7.10.4
#1 lore raw

drivers/xen/tmem.c static inline int xen_tmem_op(u32 tmem_cmd, u32 tmem_pool, struct tmem_oid oid, · line 105

Quoted 8 lines
Quoted 1 line
Quoted 1 line · Bob Liu
drivers/xen/tmem.c +0 -3
@@ -100,9 +100,6 @@ static inline int xen_tmem_op(u32 tmem_cmd, u32 tmem_pool, struct tmem_oid oid,
 	op.u.gen.oid[1] = oid.oid[1];
 	op.u.gen.oid[2] = oid.oid[2];
 	op.u.gen.index = index;
-	op.u.gen.tmem_offset = tmem_offset;
-	op.u.gen.pfn_offset = pfn_offset;
-	op.u.gen.len = len;

But you can't leave these fields uninitialized.

Jan

#2 lore raw
In reply to Bob Liu

drivers/xen/tmem.c static inline int xen_tmem_op(u32 tmem_cmd, u32 tmem_pool, struct tmem_oid oid, · line 105

Quoted 8 lines
Quoted 1 line
Quoted 1 line · Bob Liu
drivers/xen/tmem.c +0 -3
@@ -100,9 +100,6 @@ static inline int xen_tmem_op(u32 tmem_cmd, u32 tmem_pool, struct tmem_oid oid,
 	op.u.gen.oid[1] = oid.oid[1];
 	op.u.gen.oid[2] = oid.oid[2];
 	op.u.gen.index = index;
-	op.u.gen.tmem_offset = tmem_offset;
-	op.u.gen.pfn_offset = pfn_offset;
-	op.u.gen.len = len;

But you can't leave these fields uninitialized.

Jan

#3 lore raw
Quoted 11 lines · Jan Beulich

drivers/xen/tmem.c static inline int xen_tmem_op(u32 tmem_cmd, u32 tmem_pool, struct tmem_oid oid, · line 105

Quoted 8 lines
Quoted 1 line
Quoted 1 line · Bob Liu
drivers/xen/tmem.c +0 -3
@@ -100,9 +100,6 @@ static inline int xen_tmem_op(u32 tmem_cmd, u32 tmem_pool, struct tmem_oid oid,
 	op.u.gen.oid[1] = oid.oid[1];
 	op.u.gen.oid[2] = oid.oid[2];
 	op.u.gen.index = index;
-	op.u.gen.tmem_offset = tmem_offset;
-	op.u.gen.pfn_offset = pfn_offset;
-	op.u.gen.len = len;

But you can't leave these fields uninitialized.

Oh, yes.
And I should remove those members totally from struct tmem_op {}

Signature · 2 lines
Thanks,
-Bob
#4 lore raw
In reply to Jan Beulich
Quoted 11 lines · Jan Beulich

drivers/xen/tmem.c static inline int xen_tmem_op(u32 tmem_cmd, u32 tmem_pool, struct tmem_oid oid, · line 105

Quoted 8 lines
Quoted 1 line
Quoted 1 line · Bob Liu
drivers/xen/tmem.c +0 -3
@@ -100,9 +100,6 @@ static inline int xen_tmem_op(u32 tmem_cmd, u32 tmem_pool, struct tmem_oid oid,
 	op.u.gen.oid[1] = oid.oid[1];
 	op.u.gen.oid[2] = oid.oid[2];
 	op.u.gen.index = index;
-	op.u.gen.tmem_offset = tmem_offset;
-	op.u.gen.pfn_offset = pfn_offset;
-	op.u.gen.len = len;

But you can't leave these fields uninitialized.

Oh, yes.
And I should remove those members totally from struct tmem_op {}

Signature · 2 lines
Thanks,
-Bob
#5 lore raw
Quoted 15 lines
Quoted 1 line
Quoted 1 line · Bob Liu
Quoted 2 lines · Jan Beulich

Review static inline int xen_tmem_op(u32 tmem_cmd, u32

Quoted 2 lines
Quoted 1 line
Quoted 1 line · Bob Liu
(quoted diff) +0 -0
@@ -100,9 +100,6 @@ static inline int xen_tmem_op(u32 tmem_cmd, u32 

tmem_pool, struct tmem_oid oid,

Quoted 9 lines

drivers/xen/tmem.c static inline int xen_tmem_op(u32 tmem_cmd, u32 tmem_pool, struct tmem_oid oid, · line 105

Quoted 6 lines
drivers/xen/tmem.c +0 -3
 	op.u.gen.oid[1] = oid.oid[1];
 	op.u.gen.oid[2] = oid.oid[2];
 	op.u.gen.index = index;
-	op.u.gen.tmem_offset = tmem_offset;
-	op.u.gen.pfn_offset = pfn_offset;
-	op.u.gen.len = len;

But you can't leave these fields uninitialized.

Quoted 2 lines

Oh, yes.
And I should remove those members totally from struct tmem_op {}

That's an established ABI - you can't just remove members there.

Jan

#6 lore raw
In reply to Bob Liu
Quoted 15 lines
Quoted 1 line
Quoted 1 line · Bob Liu
Quoted 2 lines · Jan Beulich

Review static inline int xen_tmem_op(u32 tmem_cmd, u32

Quoted 2 lines
Quoted 1 line
Quoted 1 line · Bob Liu
(quoted diff) +0 -0
@@ -100,9 +100,6 @@ static inline int xen_tmem_op(u32 tmem_cmd, u32 

tmem_pool, struct tmem_oid oid,

Quoted 9 lines

drivers/xen/tmem.c static inline int xen_tmem_op(u32 tmem_cmd, u32 tmem_pool, struct tmem_oid oid, · line 105

Quoted 6 lines
drivers/xen/tmem.c +0 -3
 	op.u.gen.oid[1] = oid.oid[1];
 	op.u.gen.oid[2] = oid.oid[2];
 	op.u.gen.index = index;
-	op.u.gen.tmem_offset = tmem_offset;
-	op.u.gen.pfn_offset = pfn_offset;
-	op.u.gen.len = len;

But you can't leave these fields uninitialized.

Quoted 2 lines

Oh, yes.
And I should remove those members totally from struct tmem_op {}

That's an established ABI - you can't just remove members there.

Jan