All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>
Cc: Hong Kong Phoey <hongkongphoey@gmail.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] DM9000 network driver
Date: Fri, 18 Mar 2005 11:02:55 -0500	[thread overview]
Message-ID: <d120d50005031808027102fa9c@mail.gmail.com> (raw)
In-Reply-To: <20050318152554.GH17865@csclub.uwaterloo.ca>

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

  parent reply	other threads:[~2005-03-18 16:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-18 13:31 [PATCH] DM9000 network driver Sascha Hauer
2005-03-18 15:11 ` Hong Kong Phoey
2005-03-18 15:25   ` Lennart Sorensen
2005-03-18 15:55     ` John W. Linville
2005-03-18 16:02     ` Dmitry Torokhov [this message]
2005-03-18 16:04     ` linux-os
2005-03-18 16:21 ` Alan Cox
2005-03-18 16:58   ` Ben Dooks
2005-03-18 17:29     ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d120d50005031808027102fa9c@mail.gmail.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=dtor_core@ameritech.net \
    --cc=hongkongphoey@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lsorense@csclub.uwaterloo.ca \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.