From: Jiri Slaby <jirislaby@gmail.com>
To: ath5k-devel@lists.ath5k.org, linux-wireless@vger.kernel.org,
linville@tuxdriver.com, mcgrof@gmail.com, me@bobcopeland.com,
nbd@openwrt.org
Subject: Re: [PATCH 2/3] ath5k: Convert chip specific calibration data to a generic format
Date: Tue, 10 Mar 2009 13:44:30 +0100 [thread overview]
Message-ID: <49B660AE.80502@gmail.com> (raw)
In-Reply-To: <20090310103344.GC3341@makis>
On 10.3.2009 11:33, Nick Kossifidis wrote:
> --- a/drivers/net/wireless/ath5k/eeprom.c
> +++ b/drivers/net/wireless/ath5k/eeprom.c
...
> +static int
> +ath5k_eeprom_convert_pcal_info_5111(struct ath5k_hw *ah, int mode,
> + struct ath5k_chan_pcal_info *chinfo)
> +{
> + struct ath5k_eeprom_info *ee =&ah->ah_capabilities.cap_eeprom;
> + struct ath5k_chan_pcal_info_rf5111 *pcinfo;
> + struct ath5k_pdgain_info *pd;
> + u8 pier, point, idx;
> + u8 *pdgain_idx = ee->ee_pdc_to_idx[mode];
> +
> + /* Fill raw data for each calibration pier */
> + for (pier = 0; pier< ee->ee_n_piers[mode]; pier++) {
> +
> + pcinfo =&chinfo[pier].rf5111_info;
> +
> + /* Allocate pd_curves for this cal pier */
> + chinfo[pier].pd_curves =
> + kzalloc(sizeof(struct ath5k_pdgain_info) *
> + AR5K_EEPROM_N_PD_CURVES, GFP_KERNEL);
...
> + /* Allocate pd points for this curve */
> + pd->pd_step = kzalloc(sizeof(u8) *
> + AR5K_EEPROM_N_PWR_POINTS_5111,
> + GFP_KERNEL);
> + if (!pd->pd_step)
> + return -ENOMEM;
> +
> + pd->pd_pwr = kzalloc(sizeof(s16) *
> + AR5K_EEPROM_N_PWR_POINTS_5111,
> + GFP_KERNEL);
Just a nit, these 3 may be kcalloc. (and in other places too)
> static int
> ath5k_eeprom_read_pcal_info_5112(struct ath5k_hw *ah, int mode)
> {
> struct ath5k_eeprom_info *ee =&ah->ah_capabilities.cap_eeprom;
> struct ath5k_chan_pcal_info_rf5112 *chan_pcal_info;
> struct ath5k_chan_pcal_info *gen_chan_info;
> + u8 *pdgain_idx = ee->ee_pdc_to_idx[mode];
> u32 offset;
> - unsigned int i, c;
> + u8 i, c;
> u16 val;
> int ret;
> + u8 pd_gains = 0;
> +
> + /* Count how many curves we have and
> + * identify them (which one of the 4
> + * available curves we have on each count).
> + * Curves are stored from lower (x0) to
> + * higher (x3) gain */
> + memset(pdgain_idx, 0, sizeof(pdgain_idx));
Note, that sizeof(pdgain_idx) == 4 or 8 (pointer size) depending on
arch, this is likely not what you want :).
(and the other memsets too)
next prev parent reply other threads:[~2009-03-10 12:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-10 10:33 [PATCH 2/3] ath5k: Convert chip specific calibration data to a generic format Nick Kossifidis
2009-03-10 12:44 ` Jiri Slaby [this message]
2009-03-10 17:29 ` Nick Kossifidis
-- strict thread matches above, loose matches on Subject: below --
2009-03-15 20:17 Nick Kossifidis
2009-03-15 20:32 ` Jiri Slaby
2009-03-15 20:44 ` Nick Kossifidis
2009-03-15 20:46 ` Jiri Slaby
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=49B660AE.80502@gmail.com \
--to=jirislaby@gmail.com \
--cc=ath5k-devel@lists.ath5k.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=mcgrof@gmail.com \
--cc=me@bobcopeland.com \
--cc=nbd@openwrt.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 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).