Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218435
b: refs/heads/master
c: 2d3fca1
h: refs/heads/master
i:
  218433: ffded86
  218431: 652f701
v: v3
  • Loading branch information
Senthil Balasubramanian authored and John W. Linville committed Oct 25, 2010
1 parent 2892fa9 commit f5ed0f7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0dfa6dbb7372e581d3beb38b11772152114796b8
refs/heads/master: 2d3fca180710c6832de22c44155ce6a3a4953c6b
14 changes: 9 additions & 5 deletions trunk/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ static bool create_pa_curve(u32 *data_L, u32 *data_U, u32 *pa_table, u16 *gain)
(((Y[6] - Y[3]) * 1 << scale_factor) +
(x_est[6] - x_est[3])) / (x_est[6] - x_est[3]);

/* prevent division by zero */
if (G_fxp == 0)
return false;

Y_intercept =
(G_fxp * (x_est[0] - x_est[3]) +
(1 << scale_factor)) / (1 << scale_factor) + Y[3];
Expand All @@ -356,14 +360,12 @@ static bool create_pa_curve(u32 *data_L, u32 *data_U, u32 *pa_table, u16 *gain)

for (i = 0; i <= 3; i++) {
y_est[i] = i * 32;

/* prevent division by zero */
if (G_fxp == 0)
return false;

x_est[i] = ((y_est[i] * 1 << scale_factor) + G_fxp) / G_fxp;
}

if (y_est[max_index] == 0)
return false;

x_est_fxp1_nonlin =
x_est[max_index] - ((1 << scale_factor) * y_est[max_index] +
G_fxp) / G_fxp;
Expand Down Expand Up @@ -457,6 +459,8 @@ static bool create_pa_curve(u32 *data_L, u32 *data_U, u32 *pa_table, u16 *gain)

Q_scale_B = find_proper_scale(find_expn(abs(scale_B)), 10);
scale_B = scale_B / (1 << Q_scale_B);
if (scale_B == 0)
return false;
Q_beta = find_proper_scale(find_expn(abs(beta_raw)), 10);
Q_alpha = find_proper_scale(find_expn(abs(alpha_raw)), 10);
beta_raw = beta_raw / (1 << Q_beta);
Expand Down

0 comments on commit f5ed0f7

Please sign in to comment.