linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <stf_xl@wp.pl>
To: Gabor Juhos <juhosg@openwrt.org>
Cc: John Linville <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org, users@rt2x00.serialmonkey.com
Subject: Re: [rt2x00-users] [PATCH 4/5] rt2x00: rt2800lib: introduce rt2800_eeprom_word_index helper
Date: Wed, 3 Jul 2013 21:28:13 +0200	[thread overview]
Message-ID: <20130703192813.GD2245@localhost.localdomain> (raw)
In-Reply-To: <1372269318-30233-5-git-send-email-juhosg@openwrt.org>

On Wed, Jun 26, 2013 at 07:55:17PM +0200, Gabor Juhos wrote:
> Instead of assign the offset value to the
> enum directly use a new helper function to
> convert a rt2800_eeprom_word enum into an
> index of the rt2x00_dev->eeprom array.
> 
> The patch does not change the existing
> behaviour, but makes it possible to add
> support for three-chain devices which are
> using a different EEPROM layout.
> 
> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>

I have two nit-picks, but they can be fixed later on top of your current
patches.

> +	if (WARN_ON(word >= EEPROM_WORD_COUNT)) {
> +		rt2x00_warn(rt2x00dev, "invalid EEPROM word %d\n", word);
> +		return 0;
> +	}

Since we take "enum rt2800_eeprom_word" as word argument, it can not
have different values than already listed, so this warning is not needed.

> +	map = rt2800_eeprom_map;
> +	index = map[word];
> +
> +	if (WARN_ON(word != EEPROM_CHIP_ID && index == 0)) {
> +		/* Index 0 is valid only for EEPROM_CHIP_ID.
> +		 * Otherwise it means that the offset of the
> +		 * given word is not initialized in the map,
> +		 * or that the field is not usable on the
> +		 * actual chipset.
> +		 */
> +		rt2x00_warn(rt2x00dev, "invalid access of EEPROM word %d\n",
> +			    word);

I prefer not to use WARN_ON() and rt2x00_warn() together, please use just
one of them, i.e:

WARN_ONCE(word != EEPROM_CHIP_ID && index == 0,
	  "invalid access of EEPROM word %d\n", word);

Stanislaw

  reply	other threads:[~2013-07-03 19:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-26 17:55 [PATCH 0/5] rt2x00: rt2800lib: add support for extended EEPROM of three-cain devices Gabor Juhos
2013-06-26 17:55 ` [PATCH 1/5] rt2x00: rt2800lib: introduce rt2800_eeprom_word enum Gabor Juhos
2013-07-03 19:14   ` [rt2x00-users] " Stanislaw Gruszka
2013-07-05  9:05     ` Helmut Schaa
2013-06-26 17:55 ` [PATCH 2/5] rt2x00: rt2800lib: introduce local EEPROM access functions Gabor Juhos
2013-07-03 19:15   ` [rt2x00-users] " Stanislaw Gruszka
2013-06-26 17:55 ` [PATCH 3/5] rt2x00: rt2800lib: introduce rt2800_eeprom_read_from_array helper Gabor Juhos
2013-07-03 19:15   ` [rt2x00-users] " Stanislaw Gruszka
2013-06-26 17:55 ` [PATCH 4/5] rt2x00: rt2800lib: introduce rt2800_eeprom_word_index helper Gabor Juhos
2013-07-03 19:28   ` Stanislaw Gruszka [this message]
2013-07-03 20:23     ` [rt2x00-users] " Gabor Juhos
2013-07-04 18:27       ` Stanislaw Gruszka
2013-07-08  9:26         ` Gabor Juhos
2013-06-26 17:55 ` [PATCH 5/5] rt2x00: rt2800lib: add EEPROM map for the RT3593 chipset Gabor Juhos
2013-07-03 19:28   ` [rt2x00-users] " Stanislaw Gruszka

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=20130703192813.GD2245@localhost.localdomain \
    --to=stf_xl@wp.pl \
    --cc=juhosg@openwrt.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=users@rt2x00.serialmonkey.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).