Re: [PATCH v2] x86, vsyscall: Fix sparse warning: Using plain integer as NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Apr 1, 2012 at 11:48 AM, Emil Goode <emilgoode@xxxxxxxxx> wrote:
> Decided to change the comment instead as well.
>
> This patch silences the following sparse warning:
> arch/x86/kernel/vsyscall_64.c:250:34:
>       warning: Using plain integer as NULL pointer
>
> Signed-off-by: Emil Goode <emilgoode@xxxxxxxxx>
> ---
> v2: Changed comment to "NULL" instead of "0"
>
>  arch/x86/kernel/vsyscall_64.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c
> index f386dc4..7515cf0 100644
> --- a/arch/x86/kernel/vsyscall_64.c
> +++ b/arch/x86/kernel/vsyscall_64.c
> @@ -216,9 +216,9 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address)
>        current_thread_info()->sig_on_uaccess_error = 1;
>
>        /*
> -        * 0 is a valid user pointer (in the access_ok sense) on 32-bit and
> +        * NULL is a valid user pointer (in the access_ok sense) on 32-bit and
>         * 64-bit, so we don't need to special-case it here.  For all the
> -        * vsyscalls, 0 means "don't write anything" not "write it at
> +        * vsyscalls, NULL means "don't write anything" not "write it at
>         * address 0".
>         */
>        ret = -EFAULT;
> @@ -247,7 +247,7 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address)
>
>                ret = sys_getcpu((unsigned __user *)regs->di,
>                                 (unsigned __user *)regs->si,
> -                                0);
> +                                NULL);
>                break;
>        }
>
> --
> 1.7.9.1
>

Acked-by: Andy Lutomirski <luto@xxxxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux