[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87y5ajq14w.fsf@rustcorp.com.au>
Date: Sun, 09 Jun 2013 15:25:11 +0930
From: Rusty Russell <rusty@...tcorp.com.au>
To: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
Cc: Thomas Meyer <thomas@...3r.de>, mst@...hat.com,
grant.likely@...aro.org, rob.herring@...xeda.com,
linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Julia Lawall <Julia.Lawall@...6.fr>
Subject: Re: [RFC] PTR_ERR: return 0 if ptr isn't an error value.
Uwe Kleine-König <u.kleine-koenig@...gutronix.de> writes:
> Hello Rusty,
>
> [added akpm to Cc: who took the patch back then and Julia for the
> coccinelle part below]
>
> On Mon, Jun 03, 2013 at 11:59:15AM +0930, Rusty Russell wrote:
>>
>> Back in 2011, Uwe Kleine-König added the nonsensically-named
>> PTR_RET(), providing a means to avoid if() statements in code (commit
>> fa9ee9c4b9).
>>
>> Instead, just make PTR_ERR() return 0 if the pointer isn't an error
>> value. This is harmless, since PTR_ERR() should have never been
>> passed a non-error value. And GCC is usually smart enough to remove
>> the extra test if IS_ERR() has already been called.
> I wonder in which situations gcc fails to be smart enough. Did you check
> this?
Good q. I just wrote a simple test to confirm that GCC usually did,
then compared the text sizes. Since it was bigger, I assume GCC isn't
doing it all the time.
Hmm, first change is in do_debug. Ah, no surprise here:
if (notify_die(DIE_DEBUG, "debug", regs, PTR_ERR(&dr6), error_code,
SIGTRAP) == NOTIFY_STOP)
goto exit;
Huh? dr6 is on the stack? Ancient, fixed.
I'll wade through the other differences after the weekend...
Cheers,
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists