lkml.org 
[lkml]   [2003]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] add likely around access_ok for uaccess
Manfred Spraul <manfred@colorfullife.com> wrote:
>
> I noticed that gcc's autodetection (3.2.2) guesses
> the "if(access_ok())" tests in uaccess.h wrong and puts the error memset
> into the direct path and the copy out of line.
>
> The attached patch adds likely to the tests

Fair enough. There are quite a few other access_ok() callers. How
about just:

--- 25/include/asm-i386/uaccess.h~access_ok-is-likely 2003-09-14 12:29:10.000000000 -0700
+++ 25-akpm/include/asm-i386/uaccess.h 2003-09-14 12:29:24.000000000 -0700
@@ -80,7 +80,7 @@ extern struct movsl_mask {
* checks that the pointer is in the user space range - after calling
* this function, memory access functions may still return -EFAULT.
*/
-#define access_ok(type,addr,size) (__range_ok(addr,size) == 0)
+#define access_ok(type,addr,size) (likely(__range_ok(addr,size) == 0))

/**
* verify_area: - Obsolete, use access_ok()
_

-
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/

\
 
 \ /
  Last update: 2005-03-22 13:48    [W:0.037 / U:0.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site