Re: [PATCH] serial167.c: bugfixes and cleanups

From: Jes Sorensen (jes@linuxcare.com)
Date: Sat Aug 26 2000 - 09:21:17 EST


>>>>> "Tigran" == Tigran Aivazian <tigran@veritas.com> writes:

Tigran> Hi Arnaldo, On Fri, 25 Aug 2000, Arnaldo Carvalho de Melo
Tigran> wrote:
>> - copy_to_user(retinfo,&tmp,sizeof(*retinfo)); + if
>> (copy_to_user(retinfo,&tmp,sizeof(*retinfo))) + return -EFAULT;
>> return 0;

Tigran> I think Linus already suggested that you do this:

Tigran> return copy_to_user(...) ? -EFAULT : 0;

Tigran> it is compact and intuitive.

Why? the other one will, do exactly the same and is just as
readable. It's the copy_from_user_ret() that is the real problem.

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



This archive was generated by hypermail 2b29 : Thu Aug 31 2000 - 21:00:17 EST