Re: Bug in "ide-pci.c"

From: Andre Hedrick (andre@linux-ide.org)
Date: Fri Oct 06 2000 - 23:08:29 EST


On Fri, 6 Oct 2000, Sean Estabrooks wrote:

> Hi Andre,
>
> The if() logic must then rely on implementation specific compiler
> details and not have any optimizations which break this code. While it may
> "WORK" it isn't particularly reliable code.

If that is the case and it is proven then there is more code than mine
that will fail. Also if the compiler is allowed in optimizations to break
specific test order, then it is a bad compiler.

Order of operation is critical in writing code.

In my world of ATA, you dork the order of a command and you get crap on
your drive. So since there is not crap on the drive in general, I am
accounting for stupid programmer errors in the past, I call your bluff.

If you issue the command register first the the rest of the register will
execute on the next command register. This is doing thing bass-ackwards.

void go_take_a_dump (float load)
{
  if (pull_down_pants() && purge_bowles() && wipe_anus() && pull_up_pants())
     flush(load);
  else
     wear(load);
}

You do this out of order and this is more descriptive.

Now if you are complaining about logical operators in the test and how
these get optimized then you point is noted.

Since I was an astronomer and +/- one AU (93,000,000 miles) is critical,
feel free to check the rules for order. Then you can call my bluff.

Cheers,

Andre Hedrick
The Linux ATA/IDE guy

FYI, I have a new baby-girl and thus the diaper-humor!

-
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 : Sat Oct 07 2000 - 21:00:20 EST