From mboxrd@z Thu Jan 1 00:00:00 1970 From: Russell King Subject: Re: [PATCH 12/27] asm-generic: add a NOMMU uaccess.h Date: Fri, 1 May 2009 11:22:06 +0100 Message-ID: <20090501102206.GA22387@flint.arm.linux.org.uk> References: <45b4644e80c27b9d042b3960e3d99f0d444e0d92.1241105648.git.arnd@arndb.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from caramon.arm.linux.org.uk ([78.32.30.218]:33423 "EHLO caramon.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753451AbZEAKWP (ORCPT ); Fri, 1 May 2009 06:22:15 -0400 Content-Disposition: inline In-Reply-To: <45b4644e80c27b9d042b3960e3d99f0d444e0d92.1241105648.git.arnd@arndb.de> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Arnd Bergmann Cc: linux-arch@vger.kernel.org, Michal Simek , Remis Lima Baima , linux-kernel@vger.kernel.org On Thu, Nov 06, 2008 at 04:31:03PM +0100, Arnd Bergmann wrote: > +#define put_user(x, ptr) ( \ > + access_ok(VERIFY_WRITE, ptr, sizeof (*ptr)) ? \ > + __put_user(x, ptr) : \ > + -EFAULT) > + > +#ifndef __get_user > +#define __get_user(x, ptr) \ > +({ \ > + int __gu_err = 0; \ > + unsigned long __gu_val = (unsigned long)*ptr; \ > + switch (sizeof(*(ptr))) { \ > + case 1: \ > + case 2: \ > + case 4: \ > + case 8: \ > + break; \ If sizeof(unsigned long) = 4, then how can the sizeof(*(ptr)) > 4 case work? -- Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: