Refactor the switch so that a violation of
MISRA C Rule 16.2 is resolved (A switch label shall only be used
when the most closely-enclosing compound statement is the body of
a switch statement).
Note that the switch clause ending with the pseudo
keyword "fallthrough" is an allowed exception to Rule 16.3.
Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
return 0;
case XSM_TARGET:
if ( evaluate_nospec(src == target) )
- {
return 0;
+ fallthrough;
case XSM_XS_PRIV:
- if ( evaluate_nospec(is_xenstore_domain(src)) )
- return 0;
- }
- /* fall through */
+ if ( action == XSM_XS_PRIV &&
+ evaluate_nospec(is_xenstore_domain(src)) )
+ return 0;
+ fallthrough;
case XSM_DM_PRIV:
if ( target && evaluate_nospec(src->target == target) )
return 0;
- /* fall through */
+ fallthrough;
case XSM_PRIV:
if ( is_control_domain(src) )
return 0;