* [RESEND PATCH] x86: return proper error code
@ 2010-09-30 19:43 Davidlohr Bueso
2010-09-30 19:49 ` Pekka Enberg
0 siblings, 1 reply; 3+ messages in thread
From: Davidlohr Bueso @ 2010-09-30 19:43 UTC (permalink / raw)
To: tglx, mingo, hpa; +Cc: LKML, x86
x86: return -ENOMEM instead of -1 when returning on memory allocation errors in add_kmmio_fault_page()
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
---
arch/x86/mm/kmmio.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c
index e5d5e2c..36a4347 100644
--- a/arch/x86/mm/kmmio.c
+++ b/arch/x86/mm/kmmio.c
@@ -370,7 +370,7 @@ static int add_kmmio_fault_page(unsigned long page)
f = kzalloc(sizeof(*f), GFP_ATOMIC);
if (!f)
- return -1;
+ return -ENOMEM;
f->count = 1;
f->page = page;
--
1.7.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RESEND PATCH] x86: return proper error code
2010-09-30 19:43 [RESEND PATCH] x86: return proper error code Davidlohr Bueso
@ 2010-09-30 19:49 ` Pekka Enberg
2010-10-01 14:28 ` Pekka Paalanen
0 siblings, 1 reply; 3+ messages in thread
From: Pekka Enberg @ 2010-09-30 19:49 UTC (permalink / raw)
To: dave; +Cc: tglx, mingo, hpa, LKML, x86, pq
On Thu, Sep 30, 2010 at 10:43 PM, Davidlohr Bueso <dave@gnu.org> wrote:
> x86: return -ENOMEM instead of -1 when returning on memory allocation errors in add_kmmio_fault_page()
>
> Signed-off-by: Davidlohr Bueso <dave@gnu.org>
> ---
> arch/x86/mm/kmmio.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c
> index e5d5e2c..36a4347 100644
> --- a/arch/x86/mm/kmmio.c
> +++ b/arch/x86/mm/kmmio.c
> @@ -370,7 +370,7 @@ static int add_kmmio_fault_page(unsigned long page)
>
> f = kzalloc(sizeof(*f), GFP_ATOMIC);
> if (!f)
> - return -1;
> + return -ENOMEM;
>
> f->count = 1;
> f->page = page;
This doesn't matter much as register_kmmio_probe() doesn't do anything
sane with the error code and ioremap_trace_core() ignores what
register_mmio_probe() does completely. I'd either keep the code as-is
or try to fix up the fishy error handling properly.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RESEND PATCH] x86: return proper error code
2010-09-30 19:49 ` Pekka Enberg
@ 2010-10-01 14:28 ` Pekka Paalanen
0 siblings, 0 replies; 3+ messages in thread
From: Pekka Paalanen @ 2010-10-01 14:28 UTC (permalink / raw)
To: Pekka Enberg; +Cc: dave, tglx, mingo, hpa, LKML, x86
On Thu, 30 Sep 2010 22:49:36 +0300
Pekka Enberg <penberg@kernel.org> wrote:
> On Thu, Sep 30, 2010 at 10:43 PM, Davidlohr Bueso <dave@gnu.org>
> wrote:
> > x86: return -ENOMEM instead of -1 when returning on memory
> > allocation errors in add_kmmio_fault_page()
> >
> > Signed-off-by: Davidlohr Bueso <dave@gnu.org>
> > ---
> > arch/x86/mm/kmmio.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c
> > index e5d5e2c..36a4347 100644
> > --- a/arch/x86/mm/kmmio.c
> > +++ b/arch/x86/mm/kmmio.c
> > @@ -370,7 +370,7 @@ static int add_kmmio_fault_page(unsigned
> > long page)
> >
> > f = kzalloc(sizeof(*f), GFP_ATOMIC);
> > if (!f)
> > - return -1;
> > + return -ENOMEM;
> >
> > f->count = 1;
> > f->page = page;
>
> This doesn't matter much as register_kmmio_probe() doesn't do
> anything sane with the error code and ioremap_trace_core()
> ignores what register_mmio_probe() does completely. I'd either
> keep the code as-is or try to fix up the fishy error handling
> properly.
Yes, I agree completely with Pekka.
--
Pekka Paalanen
http://www.iki.fi/pq/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-10-01 14:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-30 19:43 [RESEND PATCH] x86: return proper error code Davidlohr Bueso
2010-09-30 19:49 ` Pekka Enberg
2010-10-01 14:28 ` Pekka Paalanen
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®