All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Matt Carlson <mcarlson@broadcom.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH net-next 1/7] tg3: Add 5720 ASIC rev
Date: Mon, 04 Apr 2011 11:37:42 -0700	[thread overview]
Message-ID: <1301942262.1941.60.camel@Joe-Laptop> (raw)
In-Reply-To: <1301941495-8069-2-git-send-email-mcarlson@broadcom.com>

On Mon, 2011-04-04 at 11:24 -0700, Matt Carlson wrote:
> This patch adds support for the 5720 ASIC rev.
> 
> Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
> Reviewed-by: Michael Chan <mchan@broadcom.com>
> ---
>  drivers/net/tg3.c |   67 +++++++++++++++++++++++++++++++++++++---------------
>  drivers/net/tg3.h |    5 ++++
>  2 files changed, 52 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
> index b7e03a6..b105cdd 100644
> --- a/drivers/net/tg3.c
> +++ b/drivers/net/tg3.c
> @@ -98,12 +98,14 @@
>   */
>  #define TG3_RX_STD_RING_SIZE(tp) \
>  	((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || \
> -	  GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) ? \
> +	  GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || \
> +	  GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720) ? \

Maybe it'd be better to convert all of these:

	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
	    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
	    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720)

tests to a common functions something like:

static bool can_asic_<foo>(struct tg3 *tp)
{
	int rev = GET_ASIC_REV(tp->pci_chip_rev_id);
	return (rev == ASIC_REV_5717) ||
	       (rev == ASIC_REV_5719) ||
	       (rev == ASIC_REV_5720);
}



  reply	other threads:[~2011-04-04 18:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-04 18:24 [PATCH net-next 1/7] tg3: Add 5720 ASIC rev Matt Carlson
2011-04-04 18:37 ` Joe Perches [this message]
2011-04-04 23:05   ` Matt Carlson

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=1301942262.1941.60.camel@Joe-Laptop \
    --to=joe@perches.com \
    --cc=davem@davemloft.net \
    --cc=mcarlson@broadcom.com \
    --cc=netdev@vger.kernel.org \
    /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.