• Steven Rostedt's avatar
    x86, sparse: Do not force removal of __user when calling copy_to/from_user_nocheck() · 7e878884
    Steven Rostedt authored
    commit df90ca96 upstream.
    
    Commit ff47ab4f "x86: Add 1/2/4/8 byte optimization to 64bit
    __copy_{from,to}_user_inatomic" added a "_nocheck" call in between
    the copy_to/from_user() and copy_user_generic(). As both the
    normal and nocheck versions of theses calls use the proper __user
    annotation, a typecast to remove it should not be added.
    This causes sparse to spin out the following warnings:
    
    arch/x86/include/asm/uaccess_64.h:207:47: warning: incorrect type in argument 2 (different address spaces)
    arch/x86/include/asm/uaccess_64.h:207:47:    expected void const [noderef] <asn:1>*src
    arch/x86/include/asm/uaccess_64.h:207:47:    got void const *<noident>
    arch/x86/include/asm/uaccess_64.h:207:47: warning: incorrect type in argument 2 (different address spaces)
    arch/x86/include/asm/uaccess_64.h:207:47:    expected void const [noderef] <asn:1>*src
    arch/x86/include/asm/uaccess_64.h:207:47:    got void const *<noident>
    arch/x86/include/asm/uaccess_64.h:207:47: warning: incorrect type in argument 2 (different address spaces)
    arch/x86/include/asm/uaccess_64.h:207:47:    expected void const [noderef] <asn:1>*src
    arch/x86/include/asm/uaccess_64.h:207:47:    got void const *<noident>
    arch/x86/include/asm/uaccess_64.h:207:47: warning: incorrect type in argument 2 (different address spaces)
    arch/x86/include/asm/uaccess_64.h:207:47:    expected void const [noderef] <asn:1>*src
    arch/x86/include/asm/uaccess_64.h:207:47:    got void const *<noident>
    
    Cc: Andi Kleen <ak@linux.intel.com>
    Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
    Link: http://lkml.kernel.org/r/20140103164500.5f6478f5@gandalf.local.homeSigned-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    Cc: Jaccon Bastiaansen <jaccon.bastiaansen@gmail.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: mingo@redhat.com
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: h.zuidam@computer.org
    7e878884
uaccess_64.h 7.08 KB