Re: [patch 3/2] drivers/char/vt.c: remove unnecessary code

2005-02-28 Thread Adrian Bunk
On Mon, Feb 28, 2005 at 06:29:39PM +0100, [EMAIL PROTECTED] wrote: > > > On Mon, 28 Feb 2005, Stelian Pop wrote: > > > On Mon, Feb 28, 2005 at 04:06:14PM +0100, [EMAIL PROTECTED] wrote: > > > > > + /* Setting par[]'s elems at 0. */ > > > + memset(par, 0, NPAR*sizeof(

Re: [patch 3/2] drivers/char/vt.c: remove unnecessary code

2005-02-28 Thread Stelian Pop
On Mon, Feb 28, 2005 at 06:29:39PM +0100, [EMAIL PROTECTED] wrote: > Well, without it, it gives : > > > > --- old/drivers/char/vt.c 2004-12-24 22:35:25.0 +0100 > +++ new/drivers/char/vt.c 2005-02-28 18:19:11.782717810 +0100 > @@ -1655,8 +1655,8 @@ > vc_state = ESnormal; > return; > case

Re: [patch 3/2] drivers/char/vt.c: remove unnecessary code

2005-02-28 Thread [EMAIL PROTECTED]
On Mon, 28 Feb 2005, Stelian Pop wrote: > On Mon, Feb 28, 2005 at 04:06:14PM +0100, [EMAIL PROTECTED] wrote: > > > + /* Setting par[]'s elems at 0. */ > > + memset(par, 0, NPAR*sizeof(unsigned int)); > > No need for the comment here, everybody understands C. I knew

Re: [patch 3/2] drivers/char/vt.c: remove unnecessary code

2005-02-28 Thread Stelian Pop
On Mon, Feb 28, 2005 at 04:06:14PM +0100, [EMAIL PROTECTED] wrote: > + /* Setting par[]'s elems at 0. */ > + memset(par, 0, NPAR*sizeof(unsigned int)); No need for the comment here, everybody understands C. Stelian. -- Stelian Pop <[EMAIL PROTECTED]> - To unsubs

Re: [patch 3/2] drivers/char/vt.c: remove unnecessary code

2005-02-28 Thread colbuse
>> - for(npar = 0 ; npar < NPAR ; npar++) >> + for(npar = NPAR - 1; npar >= 0; npar--) >> par[npar] = 0; >if you really want to clean this up.. Well, actually, I was not myself entirely convinced about it... This is the reason for I wrote "please _don't_ apply this, but tell me what you think

Re: [patch 3/2] drivers/char/vt.c: remove unnecessary code

2005-02-28 Thread Horst von Brand
[EMAIL PROTECTED] said: > Surlignage Russell King <[EMAIL PROTECTED]>: > > On Mon, Feb 28, 2005 at 02:13:57PM +0100, [EMAIL PROTECTED] wrote: > > > NPAR times :-). As I stated, npar is unsigned. > > I think that's disgusting then - it isn't obvious what's going on, which > > leads to mistakes. >

Re: [patch 3/2] drivers/char/vt.c: remove unnecessary code

2005-02-28 Thread Martin Mares
Hello! > I agree :) . But, if we look to the code, we can notice that there is actually > no reason for npar to be unsigned. What do you think of this version? What does it try to solve? Your version is in no way better than the previous one. The previous one was more readable and it's quite po

Re: [patch 3/2] drivers/char/vt.c: remove unnecessary code

2005-02-28 Thread Arjan van de Ven
> - for(npar = 0 ; npar < NPAR ; npar++) > + for(npar = NPAR - 1; npar >= 0; npar--) > par[npar] = 0; if you really want to clean this up.. why not use memset() instead ? - To unsubscribe from this list: send the line "unsubscribe linux-kernel"

Re: [patch 3/2] drivers/char/vt.c: remove unnecessary code

2005-02-28 Thread colbuse
Surlignage Russell King <[EMAIL PROTECTED]>: > On Mon, Feb 28, 2005 at 02:13:57PM +0100, [EMAIL PROTECTED] wrote: > > NPAR times :-). As I stated, npar is unsigned. > > I think that's disgusting then - it isn't obvious what's going on, which > leads to mistakes. > > For the sake of a micro-optim

Re: [patch 3/2] drivers/char/vt.c: remove unnecessary code

2005-02-28 Thread Dmitry Torokhov
On Mon, 28 Feb 2005 15:02:32 +0100, Arjan van de Ven <[EMAIL PROTECTED]> wrote: > \ > > > >> + for(npar = NPAR-1; npar < NPAR; npar--) > > > > > > >How many times do you want this for loop to run? > > > > > > NPAR times :-). As I stated, npar is unsigned. > > > > > > > for (npar = NPAR - 1; npar >=

Re: [patch 3/2] drivers/char/vt.c: remove unnecessary code

2005-02-28 Thread Arjan van de Ven
\ > > >> + for(npar = NPAR-1; npar < NPAR; npar--) > > > > >How many times do you want this for loop to run? > > > > NPAR times :-). As I stated, npar is unsigned. > > > > for (npar = NPAR - 1; npar >= 0; npar--) > > would be more readable and may be even faster on a dumb compiler than > your

Re: [patch 3/2] drivers/char/vt.c: remove unnecessary code

2005-02-28 Thread Dmitry Torokhov
On Mon, 28 Feb 2005 14:13:57 +0100, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > >On Mon, Feb 28, 2005 at 01:57:59PM +0100, [EMAIL PROTECTED] wrote: > >> Please _don't_ apply this, but tell me what you think about it. > > >It's broken. 8) > > >> --- old/drivers/char/vt.c 2004-12-24 22:35:25.

Re: [patch 3/2] drivers/char/vt.c: remove unnecessary code

2005-02-28 Thread linux-os
On Mon, 28 Feb 2005 [EMAIL PROTECTED] wrote: We could change an affectation into an incrementation by this patch, and, so far I know, incrementing is quicker than or as quick as setting a variable (depends on the architecture). Please _don't_ apply this, but tell me what you think about it. Note th

Re: [patch 3/2] drivers/char/vt.c: remove unnecessary code

2005-02-28 Thread Adrian Bunk
On Mon, Feb 28, 2005 at 02:13:57PM +0100, [EMAIL PROTECTED] wrote: > > >On Mon, Feb 28, 2005 at 01:57:59PM +0100, [EMAIL PROTECTED] wrote: > >> Please _don't_ apply this, but tell me what you think about it. > > >It's broken. 8) > > >> --- old/drivers/char/vt.c 2004-12-24 22:35:25.0 +010

Re: [patch 3/2] drivers/char/vt.c: remove unnecessary code

2005-02-28 Thread Russell King
On Mon, Feb 28, 2005 at 02:13:57PM +0100, [EMAIL PROTECTED] wrote: > NPAR times :-). As I stated, npar is unsigned. I think that's disgusting then - it isn't obvious what's going on, which leads to mistakes. For the sake of a micro-optimisation such as this, it's far more important that the code

Re: [patch 3/2] drivers/char/vt.c: remove unnecessary code

2005-02-28 Thread colbuse
>On Mon, Feb 28, 2005 at 01:57:59PM +0100, [EMAIL PROTECTED] wrote: >> Please _don't_ apply this, but tell me what you think about it. >It's broken. 8) >> --- old/drivers/char/vt.c 2004-12-24 22:35:25.0 +0100 >> +++ new/drivers/char/vt.c 2005-02-28 12:53:57.933256631 +0100 >> @@ -1655,9

Re: [patch 3/2] drivers/char/vt.c: remove unnecessary code

2005-02-28 Thread Russell King
On Mon, Feb 28, 2005 at 01:57:59PM +0100, [EMAIL PROTECTED] wrote: > Please _don't_ apply this, but tell me what you think about it. It's broken. 8) > --- old/drivers/char/vt.c 2004-12-24 22:35:25.0 +0100 > +++ new/drivers/char/vt.c 2005-02-28 12:53:57.933256631 +0100 > @@ -16

[patch 3/2] drivers/char/vt.c: remove unnecessary code

2005-02-28 Thread colbuse
We could change an affectation into an incrementation by this patch, and, so far I know, incrementing is quicker than or as quick as setting a variable (depends on the architecture). Please _don't_ apply this, but tell me what you think about it. Note that npar is unsigned. Signed-off-by: Emman