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

2000-08-31 Thread Rogier Wolff
Matthew Wilcox wrote: > 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, 0x, 0x8000}; > > if (!rate) return 0; > > for (; rate & 0xfc00 ;rate >>= 1, e++);

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

2000-08-31 Thread Matthew Wilcox
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, 0x, 0x8000}; > if (!rate) return 0; > for (; rate & 0xfc00 ;rate >>= 1, e++); > for (;!(rate &

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

2000-08-31 Thread Matthew Wilcox
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, 0x, 0x8000}; if (!rate) return 0; for (; rate 0xfc00 ;rate = 1, e++); for (;!(rate 0xfe00);rate = 1,

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

2000-08-31 Thread Rogier Wolff
Matthew Wilcox wrote: 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, 0x, 0x8000}; if (!rate) return 0; for (; rate 0xfc00 ;rate = 1, e++); for

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

2000-08-30 Thread Rogier Wolff
Linus Torvalds wrote: > actually prefer > > if (complex_test) > return complex_expression1; > > return complex_expression2; > > over > > return (complex_test) ? complex_expression1 : complex_expression2; Trade offs trade offs... Compare: int mr

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

2000-08-30 Thread Philipp Rumpf
On Wed, Aug 30, 2000 at 10:04:12AM -0700, Linus Torvalds wrote: > return copy_to_user(dst, src, size) ? -EFAULT : 0; > > is fine and quite readable. Fits on a simple line. I agree so far. But when it's really if (put_user(..>) return -EFAULT; if

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

2000-08-30 Thread Rogier Wolff
Arnaldo Carvalho de Melo wrote: > Em Tue, Aug 29, 2000 at 10:31:22PM +0100, Philipp Rumpf escreveu: > > On Sun, Aug 27, 2000 at 10:28:14PM +0200, Kenneth Johansson wrote: > > > Arnaldo Carvalho de Melo wrote: > > > > > > > #include > > > > @@ -510,10 +511,7 @@ > > > > if (put_user(len,

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

2000-08-30 Thread Philipp Rumpf
On Wed, Aug 30, 2000 at 10:04:12AM -0700, Linus Torvalds wrote: return copy_to_user(dst, src, size) ? -EFAULT : 0; is fine and quite readable. Fits on a simple line. I agree so far. But when it's really if (put_user(..) return -EFAULT; if

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

2000-08-30 Thread Rogier Wolff
Linus Torvalds wrote: actually prefer if (complex_test) return complex_expression1; return complex_expression2; over return (complex_test) ? complex_expression1 : complex_expression2; Trade offs trade offs... Compare: int mr (unsigned int

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

2000-08-29 Thread Arnaldo Carvalho de Melo
Em Tue, Aug 29, 2000 at 10:31:22PM +0100, Philipp Rumpf escreveu: > On Sun, Aug 27, 2000 at 10:28:14PM +0200, Kenneth Johansson wrote: > > Arnaldo Carvalho de Melo wrote: > > > > > #include > > > @@ -510,10 +511,7 @@ > > > if (put_user(len, optlen)) > > > return

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

2000-08-29 Thread Philipp Rumpf
On Sun, Aug 27, 2000 at 10:28:14PM +0200, Kenneth Johansson wrote: > Arnaldo Carvalho de Melo wrote: > > > #include > > @@ -510,10 +511,7 @@ > > if (put_user(len, optlen)) > > return -EFAULT; > > > > - if (copy_to_user(optval, , len)) > > - return

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

2000-08-29 Thread Philipp Rumpf
On Sun, Aug 27, 2000 at 10:28:14PM +0200, Kenneth Johansson wrote: 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

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

2000-08-29 Thread Arnaldo Carvalho de Melo
Em Tue, Aug 29, 2000 at 10:31:22PM +0100, Philipp Rumpf escreveu: On Sun, Aug 27, 2000 at 10:28:14PM +0200, Kenneth Johansson wrote: Arnaldo Carvalho de Melo wrote: #include linux/config.h @@ -510,10 +511,7 @@ if (put_user(len, optlen)) return -EFAULT;