lkml.org 
[lkml]   [2005]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] DM9000 network driver
    On Fri, 18 Mar 2005 10:25:54 -0500, Lennart Sorensen
    <lsorense@csclub.uwaterloo.ca> wrote:
    > On Fri, Mar 18, 2005 at 08:41:52PM +0530, Hong Kong Phoey wrote:
    > > Sacrificing readibility a little bit, you could do something useful.
    > > Instead of those ugly switch statements you could define function
    > > pointer arrays and call appropriate function
    > >
    > > switch(foo) {
    > >
    > > case 1:
    > > f1();
    > > case2 :
    > > f2();
    > > };
    > >
    > > could well become
    > >
    > > void (*func)[] = { f1, f2 };
    > >
    > > func(i);
    >
    > Ewww!
    >
    > How about sticking with obvious readable code rather than trying to save
    > a couple of conditional branches.

    On top of that I highly doibt that setting up stack frame for an
    indirect function call is less expensive than a conditional branch.

    --
    Dmitry
    -
    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 14:11    [W:0.022 / U:0.036 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site