Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755933AbbGVGJH (ORCPT ); Wed, 22 Jul 2015 02:09:07 -0400 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 Date: Wed, 22 Jul 2015 15:09:01 +0900 Message-ID: <87lhe867wi.wl-ysato@users.sourceforge.jp> From: Yoshinori Sato To: David Howells Cc: Arnd Bergmann , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] asm-generic: {get,put}_user ptr argument evaluate only 1 time In-Reply-To: <21799.1437487573@warthog.procyon.org.uk> 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> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0 Emacs/24.4 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 888 Lines: 38 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 -- 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/