Cppcheck: fix duplicate branches for if and else

Change-Id: Idcadcca42053b05e5986c8bbc4f1d3fa671fb025
Merge topic 'master' into master

fc7e7f1c Cppcheck: fix duplicate branches for if and else