acrn-hypervisor/hypervisor/common
Junjie Mao f691cab994 HV: treewide: terminate 'if .. else if' constructs with 'else'
MISRA C requires that a 'if' statement followed by one or more 'else if'
statement shall be terminated by an 'else' statement which contains either
side-effect or a comment, to ensure that conditions are considered
exhaustively.

Note that a simple 'if' statement is not required to be terminated by 'else'.

This patch fixes such violations by either refactoring the code or add the
'else' statement with either a comment (describing why this case can be skipped)
or logging the event. It may not be satisfactory for the release version where
logging is no-op, but properly handling these non-trivial cases is out of the
scope of this patch.

v1 -> v2:

    * Fix unintended semantic changes in add_(msix|intx)_remapping and
      io_instr_vmexit_handler.
    * Simplify boolean checks in vpic_ocw2.
    * Rephrase the comment in strtol_deci.

Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-07-19 14:09:36 +08:00
..
hv_main.c HV:common:fix "integer type violations" 2018-07-18 12:31:14 +08:00
hypercall.c HV: treewide: terminate 'if .. else if' constructs with 'else' 2018-07-19 14:09:36 +08:00
io_request.c HV:common:fix "integer type violations" 2018-07-18 12:31:14 +08:00
ptdev.c HV:misc:fix "signed/unsigned conversion with cast" 2018-07-16 15:45:40 +08:00
schedule.c HV: Fix missing brackets for MISRA C Violations 2018-07-13 09:09:12 +08:00
stack_protector.c HV:common:fix "expression is not Boolean" 2018-06-20 14:19:47 +08:00
trusty_hypercall.c HV: Fix missing brackets for MISRA C Violations 2018-07-13 09:09:12 +08:00
vm_load.c HV:common:fix "integer type violations" 2018-07-18 12:31:14 +08:00