Actions
Bug #2223
closedcommon/power_control.c: strange conditions
Start date:
05/04/2017
Due date:
% Done:
100%
Spec Reference:
Description
Look at the lchan_ms_pwr_ctrl():
int lchan_ms_pwr_ctrl(struct gsm_lchan *lchan, const uint8_t ms_power, const int rxLevel) { int rx; int cur_dBm, new_dBm, new_pwr; struct gsm_bts *bts = lchan->ts->trx->bts; struct gsm_bts_role_bts *btsb = bts_role_bts(bts); const enum gsm_band band = bts->band; // ... /* * What is the difference between what we want and received? * Ignore a margin that is within the range of measurement * and MS output issues. */ rx = btsb->ul_power_target - rxLevel; if (rx >= 0 && rx < 1) return 0; if (rx < 0 && rx > -1) // Unreachable return 0; // ... }
if (rx < 0 && rx > -1)
As rx has type int, it cannot be in range (-1; 0)...
if (rx >= 0 && rx < 1)
Again, the only possible value here is 0.
Updated by msuraev over 6 years ago
- Status changed from New to In Progress
- % Done changed from 0 to 10
Before making any changes, let's make sure we got proper test coverage. Gerrit 4222 and 4223 ensures that.
Updated by msuraev over 6 years ago
- Status changed from Stalled to In Progress
- % Done changed from 20 to 50
Fix is under review in gerrit 5039.
Updated by msuraev over 6 years ago
- Status changed from In Progress to Resolved
- % Done changed from 50 to 100
Gerrit 5039 has been merged.
Actions