Re: Patch?: linux-2.5.2-pre9/drivers/block/ll_rw_blk.c blk_rq_map_sg simplification

From: Adam J. Richter (
Date: Mon Jan 07 2002 - 08:23:28 EST

>>> = Adam Richter (
>> = Jens Axboe (
> = Dave Jones (
>>> The following patch removes gotos from blk_rq_map_sg, making
>>> it more readable and five lines shorter. I think the compiler should
>>> generate the same code. I have not tested this other than to
>>> verify that it compiles.
>> Well, I really think the original is much more readable than the changed
>> version :-)

>I agree. Upon seeing the patch, I was reminded of the monster
>enormous conditional at
>not quite _that_ bad, but getting there 8)

        The conditional is one level deep (it's just a list of
"and" conjunctions) and has a single conceptual meaning, "are
the segments joinable?" For what it's worth, I really could not
understand the old version until I rewrote it without gotos.

Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104 \ / San Jose, California 95129-1034
+1 408 261-6630 | g g d r a s i l United States of America
fax +1 408 261-6631 "Free Software For The Rest Of Us."
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Jan 07 2002 - 21:00:34 EST