drivers/net/wireless/ath/ath5k/phy.c +2603 ath5k_combine_pwr_to_pdadc_curves(66)
2587 /* If pdadc_0 is negative, we need to extrapolate 2588 * below this pdgain by a number of pwr_steps */ 2589 while ((pdadc_0 < 0) && (pdadc_i < 128)) { If pdadc_i ever hits 128 here then that could cause problems on line 2603. 2590 s16 tmp = pdadc_tmp[0] + pdadc_0 * pwr_step; 2591 pdadc_out[pdadc_i++] = (tmp < 0) ? 0 : (u8) tmp; 2592 pdadc_0++; 2593 } 2594 2595 /* Set last pwr level, using gain boundaries */ 2596 pdadc_n = gain_boundaries[pdg] + pd_gain_overlap - pwr_min[pdg]; 2597 /* Limit it to be inside pwr range */ 2598 table_size = pwr_max[pdg] - pwr_min[pdg]; 2599 max_idx = (pdadc_n < table_size) ? pdadc_n : table_size; 2600 2601 /* Fill pdadc_out table */ 2602 while (pdadc_0 < max_idx) 2603 pdadc_out[pdadc_i++] = pdadc_tmp[pdadc_0++]; pdadc_i would be too high and pdadc_0 could maybe still be less than zero. regards, dan carpenter _______________________________________________ ath5k-devel mailing list ath5k-devel@lists.ath5k.org https://lists.ath5k.org/mailman/listinfo/ath5k-devel