lkml.org 
[lkml]   [2000]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] cleanup on selection.c
Em Fri, Aug 25, 2000 at 10:07:03AM -0700, Linus Torvalds escreveu:
>
>
> On Fri, 25 Aug 2000, Arnaldo Carvalho de Melo wrote:
> >
> > nope, look at copy_from_user_ret in include/asm/uaccess.h
>
> .. quite frankly, we should be getting _rid_ of that horribly ugly
> construct. We should NOT add to it.
>
> The copy_from_user_ret() define is both BUGGY and UGLY: it's buggy because
> it is done as a statement expression even though it's not actually an
> expression at all.
>
> It is ugly because it fails to honour _any_ of the good rules of
> programming: it looks like a function, not a #define (as shown by the
> case), and it has non-function-behaviour.
>
> In short, avoid it like the plague. Anything that contains it is _not_ a
> cleanup, but an addign of warts. The only users of that construct from
> hell are basically bad drivers.
>
> Please just use the obvious code instead:
>
> return copy_from_user(to,from,n) ? -EFAULT : 0;
>
> and don't use the silly macro that some broken drivers insist on using.

Ok, I'll stop using it in the cleanups and start sending patches to the
maintainers, then get rid of it completely.

Good to have feedback.

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

\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.050 / U:2.224 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site