[lkml]   [2003]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: try_then_request_module
    Hi Rusty,
    hi LKML,

    On Mon, May 19, 2003 at 11:41:20AM +1000, Rusty Russell wrote:
    > If someone is feeling eager, many callers could change to
    > try_then_request_module(), eg:

    [search || request_module]

    Many implementation do this with a search and retry the search
    (if clever with a goto and a flag variable to save kernel size)
    after module loading.

    All that implemented in the search routine, which you have to
    supply anyway.

    So try_then_request_module() will consolidate the the
    branch or in the worst case just duplicating that code
    everywhere (depends on wether you implement it as a non-inline
    function or define).

    Usally this is all as simple as:

    int module_loaded_flag=0;

    /* search code */

    if (!module_loaded_flag && !found) {
    if (!request_module(bla))
    goto retry_with_module_loaded;
    return found;

    which is very space effecient and also still readable.


    Ingo Oeser
    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

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