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

From: Matthew Wilcox (matthew@wil.cx)
Date: Thu Aug 31 2000 - 09:32:41 EST


On Thu, Aug 31, 2000 at 12:26:29AM +0200, Rogier Wolff wrote:
> int mr (unsigned int rate, int r)
> {
> int e = 16+9;
> static int round[4]={0, 0, 0xffff, 0x8000};
> if (!rate) return 0;
> for (; rate & 0xfc000000 ;rate >>= 1, e++);
> for (;!(rate & 0xfe000000);rate <<= 1, e--);
> return ((rate & ~0x02000000) | (e << (16+9)) + round[r]) >> 16;
> }
>
> Dense code, right? Floating point in the kernel.... Aaargh.

you've failed Chapter 3 of CodingStyle:

HOWEVER, while mixed-case names are frowned upon, descriptive names for
global variables are a must. To call a global function "foo" is a
shooting offense.

what the hell does a function called `mr' do?

-- 
Revolutions do not require corporate support.
-
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:27 EST