From: Gabor Juhos <juhosg@openwrt.org>
To: Stanislaw Gruszka <stf_xl@wp.pl>
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: Mon, 08 Jul 2013 11:26:26 +0200 [thread overview]
Message-ID: <51DA85C2.1060509@openwrt.org> (raw)
In-Reply-To: <20130704182746.GA2061@localhost.localdomain>
Hi Stanislaw,
> On Wed, Jul 03, 2013 at 10:23:26PM +0200, Gabor Juhos wrote:
>>> 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.
>>
>> EEPROM_WORD_COUNT is listed in the enums and the word argument can be equal to
>> that, however it is not a valid index for the EEPROM map. Additionally, if
>> someone puts a new enum value after EEPROM_WORD_COUNT by mistake that will be an
>> invalid index as well.
>
> I do not feel that there is big chance that someone will do such
> mistakes, but yes, they are at least theoretically possible, so warning
> can stay.
>
>> My reason behind the rt2x00_warn call was that it shows the wiphy name. If you
>> are testing different devices in parallel it is good to know which one causes
>> the warning. However I can use 'wiphy_name(rt2x00dev->hw->wiphy)' to get that
>> information.
>>
>> I will send a follow-up patch which removes the rt2x00_warn calls. Do you also
>> prefer WARN_ONCE instead of WARN?
>
> I prefer WARN_ONCE variant to avoid possible spamming dmesg with lot of
> warnings.
Ok. Because the patch-set has not been integrated yet, I have sent an updated
version instead of a follow-up patch.
-Gabor
next prev parent reply other threads:[~2013-07-08 9:26 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 ` [rt2x00-users] " Stanislaw Gruszka
2013-07-03 20:23 ` Gabor Juhos
2013-07-04 18:27 ` Stanislaw Gruszka
2013-07-08 9:26 ` Gabor Juhos [this message]
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=51DA85C2.1060509@openwrt.org \
--to=juhosg@openwrt.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=stf_xl@wp.pl \
--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 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.