]> git.baikalelectronics.ru Git - arm-tf.git/commit
Tegra: bpmp_ipc: improve cyclomatic complexity
authorVarun Wadekar <vwadekar@nvidia.com>
Wed, 20 Jun 2018 23:12:50 +0000 (16:12 -0700)
committerVarun Wadekar <vwadekar@nvidia.com>
Thu, 20 Feb 2020 17:25:45 +0000 (09:25 -0800)
commit21368290b451b347da56e5aba6ac1bc621e3009b
tree03559487662f2e2034767c8375b1717d82e81e91
parent6f47acdb3bd8784b8c2fbdeb399ebefb496807a7
Tegra: bpmp_ipc: 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 'ipc_send_req_atomic'
handler to reduce the McCabe Cyclomatic Complexity for this function

Change-Id: I20fef79a771301e1c824aea72a45ff83f97591d5
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
plat/nvidia/tegra/common/drivers/bpmp_ipc/intf.c