lkml.org 
[lkml]   [2003]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRE: try_then_request_module
    Date
    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/

    \
     
     \ /
      Last update: 2005-03-22 13:35    [W:0.033 / U:31.288 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site