RE: try_then_request_module

Riley Williams (Riley@Williams.Name)
Mon, 19 May 2003 19:50:02 +0100


Hi Ingo.

> Usually this is all as simple as:
>
> int module_loaded_flag=0;
>
> retry_with_module_loaded:
>
> /* search code */
>
> if (!module_loaded_flag && !found) {
> module_loaded_flag=1;
> if (!request_module(bla))
> goto retry_with_module_loaded;
> }
> return found;
>
> which is very space efficient and also still readable.

Out of curiosity, what exactly is the purpose of the goto in the
above code? Since we set module_loaded_flag just prior to it, the
first if statement must fail after the goto, so we just fall down
to where we would have been without the goto.

It all looks a tad pointless to me...

Best wishes from Riley.

---
 * Nothing as pretty as a smile, nothing as ugly as a frown.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.481 / Virus Database: 277 - Release Date: 13-May-2003

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