Use the kernel-provided version, this one is broken.
Note, there are more compiler warnings now, that's due to different
types being compared, which shows how the original macro was wrong in at
least one way. They need to be fixed up.
Cc: Brett Rudley <brudley@broadcom.com>
Cc: Henry Ptasinski <henryp@broadcom.com>
Cc: Nohee Ko <noheek@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
bus->pktgen_stop = pktgen.stop;
bus->pktgen_tick = bus->pktgen_ptick = 0;
- bus->pktgen_len = MAX(bus->pktgen_len, bus->pktgen_minlen);
+ bus->pktgen_len = max(bus->pktgen_len, bus->pktgen_minlen);
bus->pktgen_len = min(bus->pktgen_len, bus->pktgen_maxlen);
/* Clear counts for a new pktgen (mode change, or was stopped) */
#define ABS(a) (((a) < 0) ? -(a) : (a))
#endif /* ABS */
-#ifndef MAX
-#define MAX(a, b) (((a) > (b)) ? (a) : (b))
-#endif /* MAX */
-
#define CEIL(x, y) (((x) + ((y)-1)) / (y))
#define ROUNDUP(x, y) ((((x)+((y)-1))/(y))*(y))
#define ISALIGNED(a, x) (((a) & ((x)-1)) == 0)
maxtxpwr = (maxtxpwr > 6) ? (maxtxpwr - 6) : 0;
- tx_pwr_max = MAX(tx_pwr_max, maxtxpwr);
+ tx_pwr_max = max(tx_pwr_max, maxtxpwr);
tx_pwr_min = min(tx_pwr_min, maxtxpwr);
}
*max_txpwr = tx_pwr_max;
if (pi->txpwr_percent <= 100)
maxtxpwr = (maxtxpwr * pi->txpwr_percent) / 100;
- tx_pwr_target[rate] = MAX(maxtxpwr, mintxpwr);
+ tx_pwr_target[rate] = max(maxtxpwr, mintxpwr);
}
tx_pwr_target[rate] =
if (tx_pwr_target[rate] > tx_pwr_max)
tx_pwr_max_rate_ind = rate;
- tx_pwr_max = MAX(tx_pwr_max, tx_pwr_target[rate]);
+ tx_pwr_max = max(tx_pwr_max, tx_pwr_target[rate]);
tx_pwr_min = min(tx_pwr_min, tx_pwr_target[rate]);
}
if (fine_gain_idx + (int)lpf_biq0 > 10) {
lpf_biq1 = 10 - lpf_biq0;
} else {
- lpf_biq1 = (u16) MAX(fine_gain_idx, 0);
+ lpf_biq1 = (u16) max(fine_gain_idx, 0);
}
wlc_phy_rfctrl_override_1tomany_nphy(pi,
NPHY_REV7_RfctrlOverride_cmd_rxgain,
(lna2 << 2) | lna1), 0x3,
0);
} else {
- hpvga = (u16) MAX(min(((int)hpvga) + delta_pwr, 10), 0);
+ hpvga = (u16) max(min(((int)hpvga) + delta_pwr, 10), 0);
wlc_phy_rfctrl_override_nphy(pi, (0x1 << 12),
((hpvga << 12) | (lpf_biq1 << 10) |
(lpf_biq0 << 8) | (mix_tia_gain <<
if (core_idx == 0) {
ref_iq_vals =
- MAX((est[0].i_pwr +
+ max((est[0].i_pwr +
est[0].q_pwr) >> (log_num_samps + 1),
1);
} else {
ref_iq_vals =
- MAX((est[1].i_pwr +
+ max((est[1].i_pwr +
est[1].q_pwr) >> (log_num_samps + 1),
1);
}
TXLPF_IDAC_4, txlpf_idac);
}
- rxlpf_rccal_hpc = MAX(min(rxlpf_rccal_hpc, 31), 0);
- txlpf_rccal_lpc = MAX(min(txlpf_rccal_lpc, 31), 0);
+ rxlpf_rccal_hpc = max(min(rxlpf_rccal_hpc, 31), 0);
+ txlpf_rccal_lpc = max(min(txlpf_rccal_lpc, 31), 0);
write_radio_reg(pi, (RADIO_2056_RX_RXLPF_RCCAL_HPC |
((rx_core ==
hpf_change = desired_log2_pwr - actual_log2_pwr;
curr_hpf += hpf_change;
- curr_hpf = MAX(min(curr_hpf, 10), 0);
+ curr_hpf = max(min(curr_hpf, 10), 0);
if (use_hpf_num == 1) {
curr_hpf1 = curr_hpf;
} else {
num =
8 * (16 * b0[tbl_id - 26] + b1[tbl_id - 26] * idx);
den = 32768 + a1[tbl_id - 26] * idx;
- pwr_est = MAX(((4 * num + den / 2) / den), -8);
+ pwr_est = max(((4 * num + den / 2) / den), -8);
if (NREV_LT(pi->pubpi.phy_rev, 3)) {
if (idx <=
(uint) (31 - idle_tssi[tbl_id - 26] + 1))
pwr_est =
- MAX(pwr_est,
+ max(pwr_est,
target_pwr_qtrdbm[tbl_id - 26] +
1);
}
plen =
pkttotlen(osh, p) + AMPDU_MAX_MPDU_OVERHEAD;
- plen = MAX(scb_ampdu->min_len, plen);
+ plen = max(scb_ampdu->min_len, plen);
if ((plen + ampdu_len) > maxlen) {
p = NULL;
maxpwr = li->maxpwr[CHANNEL_POWER_IDX_2G_CCK(chan)];
maxpwr = maxpwr - delta;
- maxpwr = MAX(maxpwr, 0);
+ maxpwr = max(maxpwr, 0);
maxpwr = min(maxpwr, conducted_max);
for (i = 0; i < WLC_NUM_RATES_CCK; i++)
}
maxpwr = maxpwr - delta;
- maxpwr = MAX(maxpwr, 0);
+ maxpwr = max(maxpwr, 0);
maxpwr = min(maxpwr, conducted_ofdm_max);
/* Keep OFDM lmit below CCK limit */
maxpwr40 = li_mimo->maxpwr40[maxpwr_idx];
maxpwr20 = maxpwr20 - delta;
- maxpwr20 = MAX(maxpwr20, 0);
+ maxpwr20 = max(maxpwr20, 0);
maxpwr40 = maxpwr40 - delta;
- maxpwr40 = MAX(maxpwr40, 0);
+ maxpwr40 = max(maxpwr40, 0);
/* Fill in the MCS 0-7 (SISO) rates */
for (i = 0; i < WLC_NUM_RATES_MCS_1_STREAM; i++) {