Pull out the shared part of a two-way conditional, and use plain "else" for the remaining latter half.
Signed-off-by: Jan Beulich <[email protected]> --- To my surprise this does change (shrink) generated code (with gcc16; albeit maybe there would be no difference in release [-O2] builds). This looks to be a result of the compiler pulling the calculations out of the loop, for being loop-invariant. --- a/xen/arch/x86/cpu/mcheck/mce.c +++ b/xen/arch/x86/cpu/mcheck/mce.c @@ -353,11 +353,13 @@ mcheck_mca_logout(enum mca_source who, s alternative_vcall(mce_callbacks.info_collect, mci, i, status); /* By default, need_clear = true */ - if ( who != MCA_MCE_SCAN && need_clear ) - /* Clear bank */ - mcabank_clear(i, status); - else if ( who == MCA_MCE_SCAN && need_clear ) - mcabanks_set(i, clear_bank); + if ( need_clear ) + { + if ( who != MCA_MCE_SCAN ) + mcabank_clear(i, status); + else + mcabanks_set(i, clear_bank); + } } if ( mig && errcnt > 0 )
