Re: [PATCH] Re: [2.6.0, pktgen] divide-by-zero

From: Matthias Urlichs
Date: Sun Jan 18 2004 - 15:00:29 EST


Hi, JÃrn Engel wrote:

> + safe_total += 1 - (!!safe_total); /* avoid divide-by-zero */

That's a (binary ;-) order of magnitude more complicated than necessary:

>> + safe_total += !safe_total; /* avoid divide-by-zero */

--
Matthias Urlichs | {M:U} IT Design @ m-u-it.de | smurf@xxxxxxxxxxxxxx
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
- -
To believe that the nonexistence of God is a fact on the level of water
not running uphill, or the moon not having an atmosphere, requires far
more faith than I could ever muster. -- Arthur D. Hlavaty

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/