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++);
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 &
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,
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
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
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
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,
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
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
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
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
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
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;
13 matches
Mail list logo