All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iSeries: Don't leak if allocations fail in mf_getSrcHistory
@ 2010-10-30 17:20 ` Jesper Juhl
  0 siblings, 0 replies; 17+ messages in thread
From: Jesper Juhl @ 2010-10-30 17:20 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Benjamin Herrenschmidt, Paul Mackerras, linux-kernel

Hi,

If memory is tight and a dynamic allocation fails there's no reason to 
make a bad situation worse by leaking memory.

mf_getSrcHistory potentially leaks pages[0-3]. I believe the right thing 
to do is to free that memory again before returning -ENOMEM - which is 
what this patch does.

I realize that the function is under '#if 0' so this probably doesn't 
matter much, but I assume that the function is still there for a reason 
(but I could be wrong, I don't know the powerpc code).
Anyway, I suggest we remove the leak.

Please keep me on CC when replying.


Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
 mf.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c
index 42d0a88..f67522a 100644
--- a/arch/powerpc/platforms/iseries/mf.c
+++ b/arch/powerpc/platforms/iseries/mf.c
@@ -1058,8 +1058,13 @@ static void mf_getSrcHistory(char *buffer, int size)
 	pages[2] = kmalloc(4096, GFP_ATOMIC);
 	pages[3] = kmalloc(4096, GFP_ATOMIC);
 	if ((ev == NULL) || (pages[0] == NULL) || (pages[1] == NULL)
-			 || (pages[2] == NULL) || (pages[3] == NULL))
+			 || (pages[2] == NULL) || (pages[3] == NULL)) {
+		kfree(pages[3]);
+		kfree(pages[2]);
+		kfree(pages[1]);
+		kfree(pages[0]);
 		return -ENOMEM;
+	}
 
 	return_stuff.xType = 0;
 	return_stuff.xRc = 0;


-- 
Jesper Juhl <jj@chaosbits.net>             http://www.chaosbits.net/
Plain text mails only, please      http://www.expita.com/nomime.html
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html


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

* [PATCH] iSeries: Don't leak if allocations fail in mf_getSrcHistory
@ 2010-10-30 17:20 ` Jesper Juhl
  0 siblings, 0 replies; 17+ messages in thread
From: Jesper Juhl @ 2010-10-30 17:20 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras, linux-kernel

Hi,

If memory is tight and a dynamic allocation fails there's no reason to 
make a bad situation worse by leaking memory.

mf_getSrcHistory potentially leaks pages[0-3]. I believe the right thing 
to do is to free that memory again before returning -ENOMEM - which is 
what this patch does.

I realize that the function is under '#if 0' so this probably doesn't 
matter much, but I assume that the function is still there for a reason 
(but I could be wrong, I don't know the powerpc code).
Anyway, I suggest we remove the leak.

Please keep me on CC when replying.


Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
 mf.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c
index 42d0a88..f67522a 100644
--- a/arch/powerpc/platforms/iseries/mf.c
+++ b/arch/powerpc/platforms/iseries/mf.c
@@ -1058,8 +1058,13 @@ static void mf_getSrcHistory(char *buffer, int size)
 	pages[2] = kmalloc(4096, GFP_ATOMIC);
 	pages[3] = kmalloc(4096, GFP_ATOMIC);
 	if ((ev == NULL) || (pages[0] == NULL) || (pages[1] == NULL)
-			 || (pages[2] == NULL) || (pages[3] == NULL))
+			 || (pages[2] == NULL) || (pages[3] == NULL)) {
+		kfree(pages[3]);
+		kfree(pages[2]);
+		kfree(pages[1]);
+		kfree(pages[0]);
 		return -ENOMEM;
+	}
 
 	return_stuff.xType = 0;
 	return_stuff.xRc = 0;


-- 
Jesper Juhl <jj@chaosbits.net>             http://www.chaosbits.net/
Plain text mails only, please      http://www.expita.com/nomime.html
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html

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

* Re: [PATCH] iSeries: Don't leak if allocations fail in mf_getSrcHistory
  2010-10-30 17:20 ` Jesper Juhl
@ 2010-11-01 11:10   ` Michael Ellerman
  -1 siblings, 0 replies; 17+ messages in thread
From: Michael Ellerman @ 2010-11-01 11:10 UTC (permalink / raw)
  To: Jesper Juhl; +Cc: linuxppc-dev, Paul Mackerras, linux-kernel, Stephen Rothwell

[-- Attachment #1: Type: text/plain, Size: 793 bytes --]

On Sat, 2010-10-30 at 19:20 +0200, Jesper Juhl wrote:
> Hi,
> 
> If memory is tight and a dynamic allocation fails there's no reason to 
> make a bad situation worse by leaking memory.
> 
> mf_getSrcHistory potentially leaks pages[0-3]. I believe the right thing 
> to do is to free that memory again before returning -ENOMEM - which is 
> what this patch does.
> 
> I realize that the function is under '#if 0' so this probably doesn't 
> matter much, but I assume that the function is still there for a reason 
> (but I could be wrong, I don't know the powerpc code).
> Anyway, I suggest we remove the leak.

Stephen is the iSeries maintainer, and I think he #if 0'ed the code. But
I don't think it will ever be un-ifdef'ed, so should probably just be
removed.

cheers


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [PATCH] iSeries: Don't leak if allocations fail in mf_getSrcHistory
@ 2010-11-01 11:10   ` Michael Ellerman
  0 siblings, 0 replies; 17+ messages in thread
From: Michael Ellerman @ 2010-11-01 11:10 UTC (permalink / raw)
  To: Jesper Juhl; +Cc: Paul Mackerras, linuxppc-dev, linux-kernel, Stephen Rothwell

[-- Attachment #1: Type: text/plain, Size: 793 bytes --]

On Sat, 2010-10-30 at 19:20 +0200, Jesper Juhl wrote:
> Hi,
> 
> If memory is tight and a dynamic allocation fails there's no reason to 
> make a bad situation worse by leaking memory.
> 
> mf_getSrcHistory potentially leaks pages[0-3]. I believe the right thing 
> to do is to free that memory again before returning -ENOMEM - which is 
> what this patch does.
> 
> I realize that the function is under '#if 0' so this probably doesn't 
> matter much, but I assume that the function is still there for a reason 
> (but I could be wrong, I don't know the powerpc code).
> Anyway, I suggest we remove the leak.

Stephen is the iSeries maintainer, and I think he #if 0'ed the code. But
I don't think it will ever be un-ifdef'ed, so should probably just be
removed.

cheers


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [PATCH] iSeries: Remove unused mf_getSrcHistory function.
  2010-11-01 20:10     ` Stephen Rothwell
@ 2010-11-01 20:06       ` Jesper Juhl
  -1 siblings, 0 replies; 17+ messages in thread
From: Jesper Juhl @ 2010-11-01 20:06 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: michael, Paul Mackerras, linuxppc-dev, linux-kernel, Stephen Rothwell

On Tue, 2 Nov 2010, Stephen Rothwell wrote:

> Hi Jesper,
> 
> On Mon, 01 Nov 2010 22:10:42 +1100 Michael Ellerman <michael@ellerman.id.au> wrote:
> >
> > On Sat, 2010-10-30 at 19:20 +0200, Jesper Juhl wrote:
> > > 
> > > If memory is tight and a dynamic allocation fails there's no reason to 
> > > make a bad situation worse by leaking memory.
> > > 
> > > mf_getSrcHistory potentially leaks pages[0-3]. I believe the right thing 
> > > to do is to free that memory again before returning -ENOMEM - which is 
> > > what this patch does.
> > > 
> > > I realize that the function is under '#if 0' so this probably doesn't 
> > > matter much, but I assume that the function is still there for a reason 
> > > (but I could be wrong, I don't know the powerpc code).
> > > Anyway, I suggest we remove the leak.
> > 
> > Stephen is the iSeries maintainer, and I think he #if 0'ed the code. But
> > I don't think it will ever be un-ifdef'ed, so should probably just be
> > removed.
> 
> Well, only unofficially iseries maintainer :-)
> 
> Yes, just remove the whole function ... it was never used and never will
> be.
> 

Done.

Remove unused function 'mf_getSrcHistory' (that will never be used ever 
according to Stephen Rothwell).

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
 mf.c |   46 ----------------------------------------------
 1 file changed, 46 deletions(-)

diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c
index 42d0a88..56cfd8c 100644
--- a/arch/powerpc/platforms/iseries/mf.c
+++ b/arch/powerpc/platforms/iseries/mf.c
@@ -1045,52 +1045,6 @@ static const struct file_operations mf_side_proc_fops = {
 	.write		= mf_side_proc_write,
 };
 
-#if 0
-static void mf_getSrcHistory(char *buffer, int size)
-{
-	struct IplTypeReturnStuff return_stuff;
-	struct pending_event *ev = new_pending_event();
-	int rc = 0;
-	char *pages[4];
-
-	pages[0] = kmalloc(4096, GFP_ATOMIC);
-	pages[1] = kmalloc(4096, GFP_ATOMIC);
-	pages[2] = kmalloc(4096, GFP_ATOMIC);
-	pages[3] = kmalloc(4096, GFP_ATOMIC);
-	if ((ev == NULL) || (pages[0] == NULL) || (pages[1] == NULL)
-			 || (pages[2] == NULL) || (pages[3] == NULL))
-		return -ENOMEM;
-
-	return_stuff.xType = 0;
-	return_stuff.xRc = 0;
-	return_stuff.xDone = 0;
-	ev->event.hp_lp_event.xSubtype = 6;
-	ev->event.hp_lp_event.x.xSubtypeData =
-		subtype_data('M', 'F', 'V', 'I');
-	ev->event.data.vsp_cmd.xEvent = &return_stuff;
-	ev->event.data.vsp_cmd.cmd = 4;
-	ev->event.data.vsp_cmd.lp_index = HvLpConfig_getLpIndex();
-	ev->event.data.vsp_cmd.result_code = 0xFF;
-	ev->event.data.vsp_cmd.reserved = 0;
-	ev->event.data.vsp_cmd.sub_data.page[0] = iseries_hv_addr(pages[0]);
-	ev->event.data.vsp_cmd.sub_data.page[1] = iseries_hv_addr(pages[1]);
-	ev->event.data.vsp_cmd.sub_data.page[2] = iseries_hv_addr(pages[2]);
-	ev->event.data.vsp_cmd.sub_data.page[3] = iseries_hv_addr(pages[3]);
-	mb();
-	if (signal_event(ev) != 0)
-		return;
-
- 	while (return_stuff.xDone != 1)
- 		udelay(10);
- 	if (return_stuff.xRc == 0)
- 		memcpy(buffer, pages[0], size);
-	kfree(pages[0]);
-	kfree(pages[1]);
-	kfree(pages[2]);
-	kfree(pages[3]);
-}
-#endif
-
 static int mf_src_proc_show(struct seq_file *m, void *v)
 {
 #if 0
 

-- 
Jesper Juhl <jj@chaosbits.net>             http://www.chaosbits.net/
Plain text mails only, please      http://www.expita.com/nomime.html
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html


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

* Re: [PATCH] iSeries: Remove unused mf_getSrcHistory function.
@ 2010-11-01 20:06       ` Jesper Juhl
  0 siblings, 0 replies; 17+ messages in thread
From: Jesper Juhl @ 2010-11-01 20:06 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: linuxppc-dev, Paul Mackerras, linux-kernel, Stephen Rothwell

On Tue, 2 Nov 2010, Stephen Rothwell wrote:

> Hi Jesper,
> 
> On Mon, 01 Nov 2010 22:10:42 +1100 Michael Ellerman <michael@ellerman.id.au> wrote:
> >
> > On Sat, 2010-10-30 at 19:20 +0200, Jesper Juhl wrote:
> > > 
> > > If memory is tight and a dynamic allocation fails there's no reason to 
> > > make a bad situation worse by leaking memory.
> > > 
> > > mf_getSrcHistory potentially leaks pages[0-3]. I believe the right thing 
> > > to do is to free that memory again before returning -ENOMEM - which is 
> > > what this patch does.
> > > 
> > > I realize that the function is under '#if 0' so this probably doesn't 
> > > matter much, but I assume that the function is still there for a reason 
> > > (but I could be wrong, I don't know the powerpc code).
> > > Anyway, I suggest we remove the leak.
> > 
> > Stephen is the iSeries maintainer, and I think he #if 0'ed the code. But
> > I don't think it will ever be un-ifdef'ed, so should probably just be
> > removed.
> 
> Well, only unofficially iseries maintainer :-)
> 
> Yes, just remove the whole function ... it was never used and never will
> be.
> 

Done.

Remove unused function 'mf_getSrcHistory' (that will never be used ever 
according to Stephen Rothwell).

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
 mf.c |   46 ----------------------------------------------
 1 file changed, 46 deletions(-)

diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c
index 42d0a88..56cfd8c 100644
--- a/arch/powerpc/platforms/iseries/mf.c
+++ b/arch/powerpc/platforms/iseries/mf.c
@@ -1045,52 +1045,6 @@ static const struct file_operations mf_side_proc_fops = {
 	.write		= mf_side_proc_write,
 };
 
-#if 0
-static void mf_getSrcHistory(char *buffer, int size)
-{
-	struct IplTypeReturnStuff return_stuff;
-	struct pending_event *ev = new_pending_event();
-	int rc = 0;
-	char *pages[4];
-
-	pages[0] = kmalloc(4096, GFP_ATOMIC);
-	pages[1] = kmalloc(4096, GFP_ATOMIC);
-	pages[2] = kmalloc(4096, GFP_ATOMIC);
-	pages[3] = kmalloc(4096, GFP_ATOMIC);
-	if ((ev == NULL) || (pages[0] == NULL) || (pages[1] == NULL)
-			 || (pages[2] == NULL) || (pages[3] == NULL))
-		return -ENOMEM;
-
-	return_stuff.xType = 0;
-	return_stuff.xRc = 0;
-	return_stuff.xDone = 0;
-	ev->event.hp_lp_event.xSubtype = 6;
-	ev->event.hp_lp_event.x.xSubtypeData =
-		subtype_data('M', 'F', 'V', 'I');
-	ev->event.data.vsp_cmd.xEvent = &return_stuff;
-	ev->event.data.vsp_cmd.cmd = 4;
-	ev->event.data.vsp_cmd.lp_index = HvLpConfig_getLpIndex();
-	ev->event.data.vsp_cmd.result_code = 0xFF;
-	ev->event.data.vsp_cmd.reserved = 0;
-	ev->event.data.vsp_cmd.sub_data.page[0] = iseries_hv_addr(pages[0]);
-	ev->event.data.vsp_cmd.sub_data.page[1] = iseries_hv_addr(pages[1]);
-	ev->event.data.vsp_cmd.sub_data.page[2] = iseries_hv_addr(pages[2]);
-	ev->event.data.vsp_cmd.sub_data.page[3] = iseries_hv_addr(pages[3]);
-	mb();
-	if (signal_event(ev) != 0)
-		return;
-
- 	while (return_stuff.xDone != 1)
- 		udelay(10);
- 	if (return_stuff.xRc == 0)
- 		memcpy(buffer, pages[0], size);
-	kfree(pages[0]);
-	kfree(pages[1]);
-	kfree(pages[2]);
-	kfree(pages[3]);
-}
-#endif
-
 static int mf_src_proc_show(struct seq_file *m, void *v)
 {
 #if 0
 

-- 
Jesper Juhl <jj@chaosbits.net>             http://www.chaosbits.net/
Plain text mails only, please      http://www.expita.com/nomime.html
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html

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

* Re: [PATCH] iSeries: Don't leak if allocations fail in mf_getSrcHistory
  2010-11-01 11:10   ` Michael Ellerman
@ 2010-11-01 20:10     ` Stephen Rothwell
  -1 siblings, 0 replies; 17+ messages in thread
From: Stephen Rothwell @ 2010-11-01 20:10 UTC (permalink / raw)
  To: michael
  Cc: Jesper Juhl, Paul Mackerras, linuxppc-dev, linux-kernel,
	Stephen Rothwell

[-- Attachment #1: Type: text/plain, Size: 1150 bytes --]

Hi Jesper,

On Mon, 01 Nov 2010 22:10:42 +1100 Michael Ellerman <michael@ellerman.id.au> wrote:
>
> On Sat, 2010-10-30 at 19:20 +0200, Jesper Juhl wrote:
> > 
> > If memory is tight and a dynamic allocation fails there's no reason to 
> > make a bad situation worse by leaking memory.
> > 
> > mf_getSrcHistory potentially leaks pages[0-3]. I believe the right thing 
> > to do is to free that memory again before returning -ENOMEM - which is 
> > what this patch does.
> > 
> > I realize that the function is under '#if 0' so this probably doesn't 
> > matter much, but I assume that the function is still there for a reason 
> > (but I could be wrong, I don't know the powerpc code).
> > Anyway, I suggest we remove the leak.
> 
> Stephen is the iSeries maintainer, and I think he #if 0'ed the code. But
> I don't think it will ever be un-ifdef'ed, so should probably just be
> removed.

Well, only unofficially iseries maintainer :-)

Yes, just remove the whole function ... it was never used and never will
be.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

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

* Re: [PATCH] iSeries: Don't leak if allocations fail in mf_getSrcHistory
@ 2010-11-01 20:10     ` Stephen Rothwell
  0 siblings, 0 replies; 17+ messages in thread
From: Stephen Rothwell @ 2010-11-01 20:10 UTC (permalink / raw)
  To: michael
  Cc: linuxppc-dev, Jesper Juhl, Paul Mackerras, linux-kernel,
	Stephen Rothwell

[-- Attachment #1: Type: text/plain, Size: 1150 bytes --]

Hi Jesper,

On Mon, 01 Nov 2010 22:10:42 +1100 Michael Ellerman <michael@ellerman.id.au> wrote:
>
> On Sat, 2010-10-30 at 19:20 +0200, Jesper Juhl wrote:
> > 
> > If memory is tight and a dynamic allocation fails there's no reason to 
> > make a bad situation worse by leaking memory.
> > 
> > mf_getSrcHistory potentially leaks pages[0-3]. I believe the right thing 
> > to do is to free that memory again before returning -ENOMEM - which is 
> > what this patch does.
> > 
> > I realize that the function is under '#if 0' so this probably doesn't 
> > matter much, but I assume that the function is still there for a reason 
> > (but I could be wrong, I don't know the powerpc code).
> > Anyway, I suggest we remove the leak.
> 
> Stephen is the iSeries maintainer, and I think he #if 0'ed the code. But
> I don't think it will ever be un-ifdef'ed, so should probably just be
> removed.

Well, only unofficially iseries maintainer :-)

Yes, just remove the whole function ... it was never used and never will
be.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

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

* Re: [PATCH] iSeries: Remove unused mf_getSrcHistory function.
  2010-11-01 21:26         ` Stephen Rothwell
@ 2010-11-01 21:20           ` Jesper Juhl
  -1 siblings, 0 replies; 17+ messages in thread
From: Jesper Juhl @ 2010-11-01 21:20 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: michael, Paul Mackerras, linuxppc-dev, linux-kernel

Hi Stephen,

On Tue, 2 Nov 2010, Stephen Rothwell wrote:

> On Mon, 1 Nov 2010 21:06:23 +0100 (CET) Jesper Juhl <jj@chaosbits.net> wrote:
> >
> > Remove unused function 'mf_getSrcHistory' (that will never be used ever 
> > according to Stephen Rothwell).
> > 
> > Signed-off-by: Jesper Juhl <jj@chaosbits.net>
> 
> Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
> 

Ok, so if you are the (unofficial) iSeries maintainer and you don't merge 
the patch somewhere that'll eventually go up-stream, but just ACK it 
(thank you for that btw), then where do I send it to get it merged?

-- 
Jesper Juhl <jj@chaosbits.net>             http://www.chaosbits.net/
Plain text mails only, please      http://www.expita.com/nomime.html
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html


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

* Re: [PATCH] iSeries: Remove unused mf_getSrcHistory function.
@ 2010-11-01 21:20           ` Jesper Juhl
  0 siblings, 0 replies; 17+ messages in thread
From: Jesper Juhl @ 2010-11-01 21:20 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linuxppc-dev, Paul Mackerras, linux-kernel

Hi Stephen,

On Tue, 2 Nov 2010, Stephen Rothwell wrote:

> On Mon, 1 Nov 2010 21:06:23 +0100 (CET) Jesper Juhl <jj@chaosbits.net> wrote:
> >
> > Remove unused function 'mf_getSrcHistory' (that will never be used ever 
> > according to Stephen Rothwell).
> > 
> > Signed-off-by: Jesper Juhl <jj@chaosbits.net>
> 
> Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
> 

Ok, so if you are the (unofficial) iSeries maintainer and you don't merge 
the patch somewhere that'll eventually go up-stream, but just ACK it 
(thank you for that btw), then where do I send it to get it merged?

-- 
Jesper Juhl <jj@chaosbits.net>             http://www.chaosbits.net/
Plain text mails only, please      http://www.expita.com/nomime.html
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html

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

* Re: [PATCH] iSeries: Remove unused mf_getSrcHistory function.
  2010-11-01 20:06       ` Jesper Juhl
@ 2010-11-01 21:26         ` Stephen Rothwell
  -1 siblings, 0 replies; 17+ messages in thread
From: Stephen Rothwell @ 2010-11-01 21:26 UTC (permalink / raw)
  To: Jesper Juhl; +Cc: michael, Paul Mackerras, linuxppc-dev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 408 bytes --]

On Mon, 1 Nov 2010 21:06:23 +0100 (CET) Jesper Juhl <jj@chaosbits.net> wrote:
>
> Remove unused function 'mf_getSrcHistory' (that will never be used ever 
> according to Stephen Rothwell).
> 
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>

Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

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

* Re: [PATCH] iSeries: Remove unused mf_getSrcHistory function.
@ 2010-11-01 21:26         ` Stephen Rothwell
  0 siblings, 0 replies; 17+ messages in thread
From: Stephen Rothwell @ 2010-11-01 21:26 UTC (permalink / raw)
  To: Jesper Juhl; +Cc: linuxppc-dev, Paul Mackerras, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 408 bytes --]

On Mon, 1 Nov 2010 21:06:23 +0100 (CET) Jesper Juhl <jj@chaosbits.net> wrote:
>
> Remove unused function 'mf_getSrcHistory' (that will never be used ever 
> according to Stephen Rothwell).
> 
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>

Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

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

* Re: [PATCH] iSeries: Remove unused mf_getSrcHistory function.
  2010-11-01 21:20           ` Jesper Juhl
  (?)
@ 2010-11-02  0:20           ` Michael Ellerman
  2010-11-04 23:29             ` [PATCH v2] iSeries: Remove unused mf_getSrcHistory function and caller Jesper Juhl
  -1 siblings, 1 reply; 17+ messages in thread
From: Michael Ellerman @ 2010-11-02  0:20 UTC (permalink / raw)
  To: Jesper Juhl; +Cc: Stephen Rothwell, Paul Mackerras, linuxppc-dev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 848 bytes --]

On Mon, 2010-11-01 at 22:20 +0100, Jesper Juhl wrote:
> Hi Stephen,
> 
> On Tue, 2 Nov 2010, Stephen Rothwell wrote:
> 
> > On Mon, 1 Nov 2010 21:06:23 +0100 (CET) Jesper Juhl <jj@chaosbits.net> wrote:
> > >
> > > Remove unused function 'mf_getSrcHistory' (that will never be used ever 
> > > according to Stephen Rothwell).
> > > 
> > > Signed-off-by: Jesper Juhl <jj@chaosbits.net>
> > 
> > Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > 
> 
> Ok, so if you are the (unofficial) iSeries maintainer and you don't merge 
> the patch somewhere that'll eventually go up-stream, but just ACK it 
> (thank you for that btw), then where do I send it to get it merged?

Here. ie. linuxppc-dev.

But, while you're removing it you should remove the #if 0'ed callsite as
well, see mf_src_proc_show() in that file. :)

cheers

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* [PATCH v2] iSeries: Remove unused mf_getSrcHistory function and caller.
  2010-11-02  0:20           ` Michael Ellerman
@ 2010-11-04 23:29             ` Jesper Juhl
  2010-11-18 19:45               ` Jesper Juhl
  0 siblings, 1 reply; 17+ messages in thread
From: Jesper Juhl @ 2010-11-04 23:29 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Stephen Rothwell, Paul Mackerras, linuxppc-dev, linux-kernel

On Tue, 2 Nov 2010, Michael Ellerman wrote:

> On Mon, 2010-11-01 at 22:20 +0100, Jesper Juhl wrote:
> > Hi Stephen,
> > 
> > On Tue, 2 Nov 2010, Stephen Rothwell wrote:
> > 
> > > On Mon, 1 Nov 2010 21:06:23 +0100 (CET) Jesper Juhl <jj@chaosbits.net> wrote:
> > > >
> > > > Remove unused function 'mf_getSrcHistory' (that will never be used ever 
> > > > according to Stephen Rothwell).
> > > > 
> > > > Signed-off-by: Jesper Juhl <jj@chaosbits.net>
> > > 
> > > Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > > 
> > 
> > Ok, so if you are the (unofficial) iSeries maintainer and you don't merge 
> > the patch somewhere that'll eventually go up-stream, but just ACK it 
> > (thank you for that btw), then where do I send it to get it merged?
> 
> Here. ie. linuxppc-dev.
> 
> But, while you're removing it you should remove the #if 0'ed callsite as
> well, see mf_src_proc_show() in that file. :)
> 
Done. See patch below.


Remove unused function 'mf_getSrcHistory' (that will never be used 
ever according to Stephen Rothwell) and also remove most of (under 'if 
0') code from mf_src_proc_show() where the function was called.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
 mf.c |   62 
--------------------------------------------------------------
 1 file changed, 62 deletions(-)

diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c
index 42d0a88..b5e026b 100644
--- a/arch/powerpc/platforms/iseries/mf.c
+++ b/arch/powerpc/platforms/iseries/mf.c
@@ -1045,71 +1045,9 @@ static const struct file_operations mf_side_proc_fops = {
 	.write		= mf_side_proc_write,
 };
 
-#if 0
-static void mf_getSrcHistory(char *buffer, int size)
-{
-	struct IplTypeReturnStuff return_stuff;
-	struct pending_event *ev = new_pending_event();
-	int rc = 0;
-	char *pages[4];
-
-	pages[0] = kmalloc(4096, GFP_ATOMIC);
-	pages[1] = kmalloc(4096, GFP_ATOMIC);
-	pages[2] = kmalloc(4096, GFP_ATOMIC);
-	pages[3] = kmalloc(4096, GFP_ATOMIC);
-	if ((ev == NULL) || (pages[0] == NULL) || (pages[1] == NULL)
-			 || (pages[2] == NULL) || (pages[3] == NULL))
-		return -ENOMEM;
-
-	return_stuff.xType = 0;
-	return_stuff.xRc = 0;
-	return_stuff.xDone = 0;
-	ev->event.hp_lp_event.xSubtype = 6;
-	ev->event.hp_lp_event.x.xSubtypeData =
-		subtype_data('M', 'F', 'V', 'I');
-	ev->event.data.vsp_cmd.xEvent = &return_stuff;
-	ev->event.data.vsp_cmd.cmd = 4;
-	ev->event.data.vsp_cmd.lp_index = HvLpConfig_getLpIndex();
-	ev->event.data.vsp_cmd.result_code = 0xFF;
-	ev->event.data.vsp_cmd.reserved = 0;
-	ev->event.data.vsp_cmd.sub_data.page[0] = iseries_hv_addr(pages[0]);
-	ev->event.data.vsp_cmd.sub_data.page[1] = iseries_hv_addr(pages[1]);
-	ev->event.data.vsp_cmd.sub_data.page[2] = iseries_hv_addr(pages[2]);
-	ev->event.data.vsp_cmd.sub_data.page[3] = iseries_hv_addr(pages[3]);
-	mb();
-	if (signal_event(ev) != 0)
-		return;
-
- 	while (return_stuff.xDone != 1)
- 		udelay(10);
- 	if (return_stuff.xRc == 0)
- 		memcpy(buffer, pages[0], size);
-	kfree(pages[0]);
-	kfree(pages[1]);
-	kfree(pages[2]);
-	kfree(pages[3]);
-}
-#endif
-
 static int mf_src_proc_show(struct seq_file *m, void *v)
 {
-#if 0
-	int len;
-
-	mf_getSrcHistory(page, count);
-	len = count;
-	len -= off;
-	if (len < count) {
-		*eof = 1;
-		if (len <= 0)
-			return 0;
-	} else
-		len = count;
-	*start = page + off;
-	return len;
-#else
 	return 0;
-#endif
 }
 
 static int mf_src_proc_open(struct inode *inode, struct file *file)



-- 
Jesper Juhl <jj@chaosbits.net>             http://www.chaosbits.net/
Plain text mails only, please      http://www.expita.com/nomime.html
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html


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

* Re: [PATCH v2] iSeries: Remove unused mf_getSrcHistory function and caller.
  2010-11-04 23:29             ` [PATCH v2] iSeries: Remove unused mf_getSrcHistory function and caller Jesper Juhl
@ 2010-11-18 19:45               ` Jesper Juhl
  2010-11-18 21:57                 ` Michael Ellerman
  0 siblings, 1 reply; 17+ messages in thread
From: Jesper Juhl @ 2010-11-18 19:45 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Stephen Rothwell, Paul Mackerras, linuxppc-dev, linux-kernel

On Fri, 5 Nov 2010, Jesper Juhl wrote:

> On Tue, 2 Nov 2010, Michael Ellerman wrote:
> 
> > On Mon, 2010-11-01 at 22:20 +0100, Jesper Juhl wrote:
> > > Hi Stephen,
> > > 
> > > On Tue, 2 Nov 2010, Stephen Rothwell wrote:
> > > 
> > > > On Mon, 1 Nov 2010 21:06:23 +0100 (CET) Jesper Juhl <jj@chaosbits.net> wrote:
> > > > >
> > > > > Remove unused function 'mf_getSrcHistory' (that will never be used ever 
> > > > > according to Stephen Rothwell).
> > > > > 
> > > > > Signed-off-by: Jesper Juhl <jj@chaosbits.net>
> > > > 
> > > > Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > > > 
> > > 
> > > Ok, so if you are the (unofficial) iSeries maintainer and you don't merge 
> > > the patch somewhere that'll eventually go up-stream, but just ACK it 
> > > (thank you for that btw), then where do I send it to get it merged?
> > 
> > Here. ie. linuxppc-dev.
> > 
> > But, while you're removing it you should remove the #if 0'ed callsite as
> > well, see mf_src_proc_show() in that file. :)
> > 
> Done. See patch below.
> 
> 
> Remove unused function 'mf_getSrcHistory' (that will never be used 
> ever according to Stephen Rothwell) and also remove most of (under 'if 
> 0') code from mf_src_proc_show() where the function was called.
> 
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>
> ---
>  mf.c |   62 
> --------------------------------------------------------------
>  1 file changed, 62 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c
> index 42d0a88..b5e026b 100644
> --- a/arch/powerpc/platforms/iseries/mf.c
> +++ b/arch/powerpc/platforms/iseries/mf.c
> @@ -1045,71 +1045,9 @@ static const struct file_operations mf_side_proc_fops = {
>  	.write		= mf_side_proc_write,
>  };
>  
> -#if 0
> -static void mf_getSrcHistory(char *buffer, int size)
> -{
> -	struct IplTypeReturnStuff return_stuff;
> -	struct pending_event *ev = new_pending_event();
> -	int rc = 0;
> -	char *pages[4];
> -
> -	pages[0] = kmalloc(4096, GFP_ATOMIC);
> -	pages[1] = kmalloc(4096, GFP_ATOMIC);
> -	pages[2] = kmalloc(4096, GFP_ATOMIC);
> -	pages[3] = kmalloc(4096, GFP_ATOMIC);
> -	if ((ev == NULL) || (pages[0] == NULL) || (pages[1] == NULL)
> -			 || (pages[2] == NULL) || (pages[3] == NULL))
> -		return -ENOMEM;
> -
> -	return_stuff.xType = 0;
> -	return_stuff.xRc = 0;
> -	return_stuff.xDone = 0;
> -	ev->event.hp_lp_event.xSubtype = 6;
> -	ev->event.hp_lp_event.x.xSubtypeData =
> -		subtype_data('M', 'F', 'V', 'I');
> -	ev->event.data.vsp_cmd.xEvent = &return_stuff;
> -	ev->event.data.vsp_cmd.cmd = 4;
> -	ev->event.data.vsp_cmd.lp_index = HvLpConfig_getLpIndex();
> -	ev->event.data.vsp_cmd.result_code = 0xFF;
> -	ev->event.data.vsp_cmd.reserved = 0;
> -	ev->event.data.vsp_cmd.sub_data.page[0] = iseries_hv_addr(pages[0]);
> -	ev->event.data.vsp_cmd.sub_data.page[1] = iseries_hv_addr(pages[1]);
> -	ev->event.data.vsp_cmd.sub_data.page[2] = iseries_hv_addr(pages[2]);
> -	ev->event.data.vsp_cmd.sub_data.page[3] = iseries_hv_addr(pages[3]);
> -	mb();
> -	if (signal_event(ev) != 0)
> -		return;
> -
> - 	while (return_stuff.xDone != 1)
> - 		udelay(10);
> - 	if (return_stuff.xRc == 0)
> - 		memcpy(buffer, pages[0], size);
> -	kfree(pages[0]);
> -	kfree(pages[1]);
> -	kfree(pages[2]);
> -	kfree(pages[3]);
> -}
> -#endif
> -
>  static int mf_src_proc_show(struct seq_file *m, void *v)
>  {
> -#if 0
> -	int len;
> -
> -	mf_getSrcHistory(page, count);
> -	len = count;
> -	len -= off;
> -	if (len < count) {
> -		*eof = 1;
> -		if (len <= 0)
> -			return 0;
> -	} else
> -		len = count;
> -	*start = page + off;
> -	return len;
> -#else
>  	return 0;
> -#endif
>  }
>  
>  static int mf_src_proc_open(struct inode *inode, struct file *file)
> 
> 
> 
> 

PING.

Is this going to get merged somewhere or is there a problem?


-- 
Jesper Juhl <jj@chaosbits.net>            http://www.chaosbits.net/
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please.


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

* Re: [PATCH v2] iSeries: Remove unused mf_getSrcHistory function and caller.
  2010-11-18 21:57                 ` Michael Ellerman
@ 2010-11-18 21:51                   ` Jesper Juhl
  0 siblings, 0 replies; 17+ messages in thread
From: Jesper Juhl @ 2010-11-18 21:51 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Stephen Rothwell, Paul Mackerras, linuxppc-dev, linux-kernel

On Fri, 19 Nov 2010, Michael Ellerman wrote:

> On Thu, 2010-11-18 at 20:45 +0100, Jesper Juhl wrote:
> > On Fri, 5 Nov 2010, Jesper Juhl wrote:
> > >  
> > >  static int mf_src_proc_open(struct inode *inode, struct file *file)
> 
> > PING.
> > 
> > Is this going to get merged somewhere or is there a problem?
> 
> Yes, no.
> 
> It won't get lost:
> http://patchwork.ozlabs.org/patch/70201/
> 
Ok. Thank you for that bit of information. That was one place that I had 
no knowledge about what-so-ever, so I didn't look.

I will now rest happily in the knowledge that the patch is in good hands. 
Thanks.


-- 
Jesper Juhl <jj@chaosbits.net>            http://www.chaosbits.net/
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please.


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

* Re: [PATCH v2] iSeries: Remove unused mf_getSrcHistory function and caller.
  2010-11-18 19:45               ` Jesper Juhl
@ 2010-11-18 21:57                 ` Michael Ellerman
  2010-11-18 21:51                   ` Jesper Juhl
  0 siblings, 1 reply; 17+ messages in thread
From: Michael Ellerman @ 2010-11-18 21:57 UTC (permalink / raw)
  To: Jesper Juhl; +Cc: Stephen Rothwell, Paul Mackerras, linuxppc-dev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 345 bytes --]

On Thu, 2010-11-18 at 20:45 +0100, Jesper Juhl wrote:
> On Fri, 5 Nov 2010, Jesper Juhl wrote:
> >  
> >  static int mf_src_proc_open(struct inode *inode, struct file *file)

> PING.
> 
> Is this going to get merged somewhere or is there a problem?

Yes, no.

It won't get lost:
http://patchwork.ozlabs.org/patch/70201/

cheers


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

end of thread, other threads:[~2010-11-18 22:04 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-30 17:20 [PATCH] iSeries: Don't leak if allocations fail in mf_getSrcHistory Jesper Juhl
2010-10-30 17:20 ` Jesper Juhl
2010-11-01 11:10 ` Michael Ellerman
2010-11-01 11:10   ` Michael Ellerman
2010-11-01 20:10   ` Stephen Rothwell
2010-11-01 20:10     ` Stephen Rothwell
2010-11-01 20:06     ` [PATCH] iSeries: Remove unused mf_getSrcHistory function Jesper Juhl
2010-11-01 20:06       ` Jesper Juhl
2010-11-01 21:26       ` Stephen Rothwell
2010-11-01 21:26         ` Stephen Rothwell
2010-11-01 21:20         ` Jesper Juhl
2010-11-01 21:20           ` Jesper Juhl
2010-11-02  0:20           ` Michael Ellerman
2010-11-04 23:29             ` [PATCH v2] iSeries: Remove unused mf_getSrcHistory function and caller Jesper Juhl
2010-11-18 19:45               ` Jesper Juhl
2010-11-18 21:57                 ` Michael Ellerman
2010-11-18 21:51                   ` Jesper Juhl

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.