[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130617050310.GA4560@osiris>
Date: Mon, 17 Jun 2013 07:03:10 +0200
From: Heiko Carstens <heiko.carstens@...ibm.com>
To: Rusty Russell <rusty@...tcorp.com.au>
Cc: linux-kernel@...r.kernel.org,
Christian Borntraeger <borntraeger@...ibm.com>,
Martin Schwidefsky <schwidefsky@...ibm.com>
Subject: Re: [PATCH 3/9] s390: Replace weird use of PTR_RET.
On Sun, Jun 16, 2013 at 02:12:42PM +0930, Rusty Russell wrote:
> Saves repeating "(void __force *)__uptr" but it's less clear. Using
> the output of PTR_RET() to determine the error rather than just
> testing IS_ERR() is odd.
Ok, if it's confusing I won't mind if it gets changed. I intended to
keep the code as short as possible, but.. ;)
> For example, I *assume* __gptr_to_uptr() never returns NULL? Because
> the __ret would be 0 for the old code. The new version is clearer, IMHO:
> it would try to get_user() on that address.
__gptr_to_uptr() could return 0 and it's not an error case. In that case
it should indeed try a to get_user() on that address.
> If you hate this variant, I can just s/PTR_RET/PTR_ERR_OR_ZERO/ instead.
Your patch is fine.
> Cc: Heiko Carstens <heiko.carstens@...ibm.com>
> Cc: Christian Borntraeger <borntraeger@...ibm.com>
> Cc: Martin Schwidefsky <schwidefsky@...ibm.com>
> Signed-off-by: Rusty Russell <rusty@...tcorp.com.au>
> ---
> arch/s390/kvm/gaccess.h | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
Acked-by: Heiko Carstens <heiko.carstens@...ibm.com>
--
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