mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] xen: tmem: rmove useless parameters
@ 2013-11-20  8:52 Bob Liu
  2013-11-20  9:10 ` Jan Beulich
  0 siblings, 1 reply; 4+ messages in thread
From: Bob Liu @ 2013-11-20  8:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: xen-devel, konrad.wilk, JBeulich, ian.campbell, keir, Bob Liu

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

Signed-off-by: Bob Liu <bob.liu@oracle.com>
---
 drivers/xen/tmem.c |   18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/xen/tmem.c b/drivers/xen/tmem.c
index 83b5c53..9fd0fdc 100644
--- a/drivers/xen/tmem.c
+++ b/drivers/xen/tmem.c
@@ -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 */
-- 
1.7.10.4


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

* Re: [PATCH] xen: tmem: rmove useless parameters
  2013-11-20  8:52 [PATCH] xen: tmem: rmove useless parameters Bob Liu
@ 2013-11-20  9:10 ` Jan Beulich
  2013-11-20  9:22   ` Bob Liu
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2013-11-20  9:10 UTC (permalink / raw)
  To: Bob Liu; +Cc: ian.campbell, xen-devel, Bob Liu, konrad.wilk, linux-kernel, keir

>>> On 20.11.13 at 09:52, Bob Liu <lliubbo@gmail.com> wrote:
> @@ -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


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

* Re: [PATCH] xen: tmem: rmove useless parameters
  2013-11-20  9:10 ` Jan Beulich
@ 2013-11-20  9:22   ` Bob Liu
  2013-11-20  9:26     ` Jan Beulich
  0 siblings, 1 reply; 4+ messages in thread
From: Bob Liu @ 2013-11-20  9:22 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Bob Liu, ian.campbell, xen-devel, konrad.wilk, linux-kernel, keir


On 11/20/2013 05:10 PM, Jan Beulich wrote:
>>>> On 20.11.13 at 09:52, Bob Liu <lliubbo@gmail.com> wrote:
>> @@ -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 {}

-- 
Thanks,
-Bob

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

* Re: [PATCH] xen: tmem: rmove useless parameters
  2013-11-20  9:22   ` Bob Liu
@ 2013-11-20  9:26     ` Jan Beulich
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Beulich @ 2013-11-20  9:26 UTC (permalink / raw)
  To: Bob Liu; +Cc: ian.campbell, Bob Liu, xen-devel, konrad.wilk, linux-kernel, keir

>>> On 20.11.13 at 10:22, Bob Liu <bob.liu@oracle.com> wrote:
> On 11/20/2013 05:10 PM, Jan Beulich wrote:
>>>>> On 20.11.13 at 09:52, Bob Liu <lliubbo@gmail.com> wrote:
>>> @@ -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 {}

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

Jan


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

end of thread, other threads:[~2013-11-20  9:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-20  8:52 [PATCH] xen: tmem: rmove useless parameters Bob Liu
2013-11-20  9:10 ` Jan Beulich
2013-11-20  9:22   ` Bob Liu
2013-11-20  9:26     ` Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®