From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yoshinori Sato Subject: Re: [PATCH v3] asm-generic: {get,put}_user ptr argument evaluate only 1 time Date: Wed, 22 Jul 2015 15:09:01 +0900 Message-ID: <87lhe867wi.wl-ysato@users.sourceforge.jp> References: <1437459289-26553-1-git-send-email-ysato@users.sourceforge.jp> <1437023722-7432-1-git-send-email-ysato@users.sourceforge.jp> <21799.1437487573@warthog.procyon.org.uk> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from mail2.asahi-net.or.jp ([202.224.39.198]:18541 "EHLO mail2.asahi-net.or.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751836AbbGVGJF (ORCPT ); Wed, 22 Jul 2015 02:09:05 -0400 In-Reply-To: <21799.1437487573@warthog.procyon.org.uk> Sender: linux-arch-owner@vger.kernel.org List-ID: To: David Howells Cc: Arnd Bergmann , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org On Tue, 21 Jul 2015 23:06:13 +0900, David Howells wrote: > > Yoshinori Sato wrote: > > > #define get_user(x, ptr) \ > > ({ \ > > + uintptr_t __uip = (uintptr_t)(ptr); \ > > const? OK. > > might_fault(); \ > > - access_ok(VERIFY_READ, ptr, sizeof(*ptr)) ? \ > > - __get_user(x, ptr) : \ > > + access_ok(VERIFY_READ, __uip, sizeof(*ptr)) ? \ > > + __get_user((x), (__typeof__(*ptr) *)__uip) : \ > > -EFAULT; \ > > }) > > Would it be better to use void* instead of uintptr_t? No reason. I'll changed void* Thanks. > David -- Yoshinori Sato