Re: [PATCH] af_rose.c: s/suser/capable/ + micro cleanups

From: Albert D. Cahalan (acahalan@cs.uml.edu)
Date: Sun Aug 27 2000 - 16:33:03 EST


Kenneth Johansson writes:
> Arnaldo Carvalho de Melo wrote:

>> #include <linux/config.h>
>> @@ -510,10 +511,7 @@
>> if (put_user(len, optlen))
>> return -EFAULT;
>>
>> - if (copy_to_user(optval, &val, len))
>> - return -EFAULT;
>> -
>> - return 0;
>> + return copy_to_user(optval, &val, len) ? -EFAULT : 0;
>> }
>
> What is this are you trying to compress the source code ?
> I like the old way better. I think it is faster to read and understand.

The new way is faster to read and understand when you consider
that this code isn't all alone. With the new way, my editor can
display 300% more code. This reduces screen-to-brain latency by
reducing the need to scroll.

Scrolling kills productivity.

I'd really rant if I still used a VT100 or the Linux console.

The new way better even if it didn't save space. It clearly
expresses that _something_, to be chosen based on the copy function,
will be returned. This isn't a case of one code path that returns
and one that does lots of other stuff. Hey, be glad the ?: operator
didn't get nested a few times, maybe with the comma operator thrown
in for extra fun. You just have to get used to it.
-
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:19 EST