Re: OT: Does Linux have any "Perfect Code"

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Russell Leighton <russ@...>
Cc: LKML <linux-kernel@...>
Date: Thursday, November 15, 2007 - 4:27 am

On Wed, 14 Nov 2007 at 20:21 +0000, Russell Leighton wrote:


This code is far to be perfect, some part is outdated, bcopy() use instead
of memcpy() for example. More annoying are the comment, the file is 3306
lines while there is only 1640 line of code, nothing bad per se but looking
some comments:

 		/*
 		 * Before we begin this operation, disable kernel preemption.
 		 */
 		kpreempt_disable();


uhh...

or 

 	if (cyclic->cy_pend != 0) {
		/*
 		 * The pend is non-zero; ...

I will never guessed that, w/o the comment :)

 		/*
 		 * We have both a left and a right child.  We need to compare
 		 * the expiration times of the children to determine which
 		 * expires earlier.
 		 */
 		if (cyclics[right].cy_expire < cyclics[left].cy_expire) {

writing array[index] in C is already a promise than index is in
[0-array size)

-- 
Phe

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
OT: Does Linux have any "Perfect Code", Russell Leighton, (Wed Nov 14, 9:21 pm)
Re: OT: Does Linux have any "Perfect Code", Philippe Elie, (Thu Nov 15, 4:27 am)
Re: OT: Does Linux have any "Perfect Code", Michael Gerdau, (Thu Nov 15, 9:16 am)
Re: OT: Does Linux have any "Perfect Code", Chris Friesen, (Thu Nov 15, 1:05 pm)
Re: OT: Does Linux have any "Perfect Code", Daniel Barkalow, (Thu Nov 15, 11:10 am)
Re: OT: Does Linux have any "Perfect Code", Geert Uytterhoeven, (Sat Nov 17, 4:44 am)
Re: OT: Does Linux have any "Perfect Code", Eric Dumazet, (Thu Nov 15, 2:29 am)
Re: OT: Does Linux have any "Perfect Code", Andi Kleen, (Thu Nov 15, 3:43 am)
Re: OT: Does Linux have any "Perfect Code", David Miller, (Thu Nov 15, 3:11 am)
Re: OT: Does Linux have any "Perfect Code", David Miller, (Wed Nov 14, 9:33 pm)