netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Michael Chan <mchan@broadcom.com>
Cc: netdev <netdev@vger.kernel.org>,
	Hauke Mehrtens <hauke@hauke-m.de>,
	mcarlson@broadcom.com, nsujir@broadcom.com
Subject: Re: [RFC PATCH] tg3: Convert chip type macros to inline functions
Date: Wed, 06 Feb 2013 17:05:38 -0800	[thread overview]
Message-ID: <1360199138.12464.37.camel@joe-AO722> (raw)
In-Reply-To: <1360197671.796.3.camel@LTIRV-MCHAN1.corp.ad.broadcom.com>

On Wed, 2013-02-06 at 16:41 -0800, Michael Chan wrote:
> On Wed, 2013-02-06 at 15:44 -0800, Joe Perches wrote:
> > There are several macros that are used for
> > chip identification.
> > 
> > Perhaps it'd be better to use static inlines
> > instead of these macros as the code becomes a
> > bit more readable with less uppercase use.
[]
> > #define GET_ASIC_REV(CHIP_REV_ID)       ((CHIP_REV_ID) >> 12)
> > 
> > becomes:
> > 
> > static inline u32 tg3_asic_rev(const struct tg3 *tp)
> > {
> >         return tp->pci_chip_rev_id >> 12;
> > }

[]

> I think these don't have to be inline.  there is only one call in the
> fast path that I can see (tg3_start_xmit), and we can easily change that
> to test for a flag instead.  I wonder if that will make it smaller.

Nope.

Even if you make it static in tg3.c,
gcc inlines it anyway.

  reply	other threads:[~2013-02-07  1:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-06 23:44 [RFC PATCH] tg3: Convert chip type macros to inline functions Joe Perches
2013-02-07  0:41 ` Michael Chan
2013-02-07  1:05   ` Joe Perches [this message]
2013-02-11  0:39 ` David Miller
2013-02-11  1:34   ` Joe Perches
2013-02-12  1:43     ` Joe Perches

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=1360199138.12464.37.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=hauke@hauke-m.de \
    --cc=mcarlson@broadcom.com \
    --cc=mchan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=nsujir@broadcom.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).