Re: [PATCH v3 3/4] exec: unify do_execve/compat_do_execve code

From: KOSAKI Motohiro
Date: Wed Mar 02 2011 - 22:13:16 EST


> @@ -1510,11 +1528,27 @@ int do_execve(const char *filename,
> const char __user *const __user *__envp,
> struct pt_regs *regs)
> {
> - struct conditional_ptr argv = { .native = __argv };
> - struct conditional_ptr envp = { .native = __envp };
> + struct conditional_ptr argv = { .ptr.native = __argv };
> + struct conditional_ptr envp = { .ptr.native = __envp };
> return do_execve_common(filename, argv, envp, regs);
> }
>
> +#ifdef CONFIG_COMPAT
> +int compat_do_execve(char *filename,
> + compat_uptr_t __user *__argv,
> + compat_uptr_t __user *__envp,
> + struct pt_regs *regs)
> +{
> + struct conditional_ptr argv = {
> + .is_compat = true, .ptr.compat = __argv,
> + };

Please don't mind to compress a line.

struct conditional_ptr argv = {
.is_compat = true,
.ptr.compat = __argv,
};

is more good readability.


Other parts looks very good to me.
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx>



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/