Project

General

Profile

Actions

Bug #2223

closed

common/power_control.c: strange conditions

Added by fixeria almost 7 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
High
Assignee:
Category:
-
Target version:
-
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.

Actions #1

Updated by laforge almost 7 years ago

Actions #2

Updated by laforge almost 7 years ago

  • Assignee set to msuraev
Actions #3

Updated by laforge over 6 years ago

  • Priority changed from Normal to High
Actions #4

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.

Actions #5

Updated by msuraev over 6 years ago

  • Status changed from In Progress to Stalled
Actions #6

Updated by msuraev over 6 years ago

  • % Done changed from 10 to 20

Gerrit 4222 and 4223 are merged.

Actions #7

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.

Actions #8

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 #9

Updated by laforge about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)