All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Jay Cliburn <jacliburn@bellsouth.net>
Cc: jeff@garzik.org, shemminger@osdl.org, csnook@redhat.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	atl1-devel@lists.sourceforge.net
Subject: Re: [PATCH 4/4] atl1: Ancillary C files for Attansic L1 driver
Date: Thu, 11 Jan 2007 09:37:20 +0000	[thread overview]
Message-ID: <20070111093720.GD3141@infradead.org> (raw)
In-Reply-To: <20070111004316.GE2624@osprey.hogchain.net>

> +#define ATL1_STATS_LEN sizeof(atl1_gstrings_stats) / sizeof(struct atl1_stats)

Just use an opencoded ARRAY_SIZE().

> +void atl1_read_pci_cfg(struct atl1_hw *hw, u32 reg, u16 * value)
> +{
> +        struct atl1_adapter *adapter = hw->back;
> +        pci_read_config_word(adapter->pdev, reg, value);
> +}
> +
> +void atl1_write_pci_cfg(struct atl1_hw *hw, u32 reg, u16 * value)
> +{
> +        struct atl1_adapter *adapter = hw->back;
> +        pci_write_config_word(adapter->pdev, reg, *value);
> +}

Please just kill these types of wrappers and use pci_read_config_word/
pci_write_config_word directly.

> +static inline bool atl1_eth_address_valid(u8 * p_addr)
> +{
> +	/* Invalid PermanentAddress ? */
> +	if (((p_addr[0] == 0) &&
> +	     (p_addr[1] == 0) &&
> +	     (p_addr[2] == 0) &&
> +	     (p_addr[3] == 0) && (p_addr[4] == 0) && (p_addr[5] == 0)
> +	    ) || (p_addr[0] & 1)) 
> +		/* Multicast address or Broadcast Address */
> +		return false;
> +
> +	return true;
> +}

Don't we have a generic helper for this kind of thing?


  reply	other threads:[~2007-01-11  9:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-11  0:43 [PATCH 4/4] atl1: Ancillary C files for Attansic L1 driver Jay Cliburn
2007-01-11  9:37 ` Christoph Hellwig [this message]
2007-01-19  3:00 ` Jeff Garzik
  -- strict thread matches above, loose matches on Subject: below --
2007-01-21 21:07 Jay Cliburn
2007-01-22  2:31 ` Randy Dunlap
2007-01-22  3:33   ` Jay Cliburn
2007-01-22 20:00     ` Luca Tettamanti
2007-01-23 19:25       ` Stephen Hemminger
2007-01-23 21:19         ` Luca Tettamanti
2007-01-27 21:02           ` Jay Cliburn
2007-01-27 21:15             ` Jeff Garzik
2007-01-27 22:05               ` Jay Cliburn
2007-01-27 22:38                 ` Jeff Garzik
2007-01-23 21:33         ` Jeff Garzik
2007-01-23 21:34           ` Stephen Hemminger
2007-01-23 21:46             ` Randy Dunlap
2007-01-23 22:06               ` Jeff Garzik
2006-11-19 20:31 Jay Cliburn
2006-11-20 12:40 ` Chris Snook

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=20070111093720.GD3141@infradead.org \
    --to=hch@infradead.org \
    --cc=atl1-devel@lists.sourceforge.net \
    --cc=csnook@redhat.com \
    --cc=jacliburn@bellsouth.net \
    --cc=jeff@garzik.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@osdl.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.