Re: [PATCH 1/2] ath: Fix ath_dbg uses missing newlines and accessbeyond array bound

From: Luis R. Rodriguez
Date: Thu Dec 02 2010 - 14:02:49 EST


On Wed, Dec 01, 2010 at 09:13:32PM -0800, Joe Perches wrote:
> Add missing newlines to ath_dbg uses
> ar9300RateSize is not a power of 4, fix to print array line by line.
>
> Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>
> ---
> drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 29 ++---------------------
> drivers/net/wireless/ath/ath9k/calib.c | 4 +-
> drivers/net/wireless/ath/ath9k/gpio.c | 6 ++--
> drivers/net/wireless/ath/ath9k/htc_drv_gpio.c | 7 ++---
> drivers/net/wireless/ath/ath9k/htc_drv_main.c | 2 +-
> 5 files changed, 12 insertions(+), 36 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
> index e6ae62b..beb3e87 100644
> --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
> +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
> @@ -3342,7 +3342,7 @@ static int ar9300_eeprom_restore_internal(struct ath_hw *ah,
> goto fail;
>
> found:
> - ath_dbg(common, ATH_DBG_EEPROM, "Found valid EEPROM data");
> + ath_dbg(common, ATH_DBG_EEPROM, "Found valid EEPROM data\n");
>
> for (it = 0; it < MSTATE; it++) {
> if (!read(ah, cptr, word, COMP_HDR_LEN))
> @@ -4084,22 +4084,9 @@ static void ar9003_hw_set_target_power_eeprom(struct ath_hw *ah, u16 freq,
> ar9003_hw_eeprom_get_ht40_tgt_pwr(ah, HT_TARGET_RATE_23, freq,
> is2GHz) + ht40PowerIncForPdadc;
>
> - while (i < ar9300RateSize) {
> - ath_dbg(common, ATH_DBG_EEPROM,
> - "TPC[%02d] 0x%08x ", i, targetPowerValT2[i]);
> - i++;
> -
> - ath_dbg(common, ATH_DBG_EEPROM,
> - "TPC[%02d] 0x%08x ", i, targetPowerValT2[i]);
> - i++;
> -
> - ath_dbg(common, ATH_DBG_EEPROM,
> - "TPC[%02d] 0x%08x ", i, targetPowerValT2[i]);
> - i++;
> -
> + for (i = 0; i < ar9300RateSize; i++) {
> ath_dbg(common, ATH_DBG_EEPROM,
> "TPC[%02d] 0x%08x\n", i, targetPowerValT2[i]);
> - i++;
> }
> }

Please send this hunk on a separate patch.

Luis

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/