]> git.baikalelectronics.ru Git - arm-tf.git/commit
Tegra: common: improve cyclomatic complexity
authorVarun Wadekar <vwadekar@nvidia.com>
Wed, 20 Jun 2018 20:43:43 +0000 (13:43 -0700)
committerVarun Wadekar <vwadekar@nvidia.com>
Thu, 20 Feb 2020 17:25:45 +0000 (09:25 -0800)
commitee21281a5f738f00eeb2a17a775035bae70245ce
tree34ff215562cfd4ac2e1b353fdfbef1e2b8e5bbe0
parent37f760241e75bbfa5c4043f9e451fc0ce7ed42f7
Tegra: common: improve cyclomatic complexity

Code complexity is a good indication of maintainability versus
testability of a piece of software.

ISO26262 introduces the following thresholds:

    complexity < 10 is accepted
    10 <= complexity < 20 has to be justified
    complexity >= 20 cannot be accepted

Rationale is that number of test cases to fully test a piece of
software can (depending on the coverage metrics) grow exponentially
with the number of branches in the software.

This patch removes redundant conditionals from 'bl31_early_platform_setup'
handler to reduce the McCabe Cyclomatic Complexity for this function.

Change-Id: Ifb628e33269b388f9323639cd97db761a7e049c4
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
plat/nvidia/tegra/common/tegra_bl31_setup.c