• Soby Mathew's avatar
    PSCI: Resolve GCC static analysis false positive · 6d18969f
    Soby Mathew authored
    When BL31 is compiled at `-O3` optimization level using Linaro GCC 4.9
    AArch64 toolchain, it reports the following error:
    
    ```
    services/std_svc/psci/psci_common.c: In function 'psci_do_state_coordination':
    services/std_svc/psci/psci_common.c:220:27: error: array subscript is above
    array bounds [-Werror=array-bounds]
      psci_req_local_pwr_states[pwrlvl - 1][cpu_idx] = req_pwr_state;
                               ^
    ```
    
    This error is a false positive and this patch resolves the error by asserting
    the array bounds in `psci_do_state_coordination()`.
    
    Fixes ARM-software/tf-issues#347
    
    Change-Id: I3584ed7b2e28faf455b082cb3281d6e1d11d6495
    6d18969f
psci_common.c 33.9 KB