From: Chuck Anderson Date: Mon, 26 Feb 2018 08:20:30 +0000 (-0800) Subject: retpoline: add brackets to check_ibrs_inuse() and clear_ibpb_inuse() X-Git-Tag: v4.1.12-124.31.3~1108 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=576845ce0db2cb12621f9e5a57bfa606678ee1f1;p=users%2Fjedix%2Flinux-maple.git retpoline: add brackets to check_ibrs_inuse() and clear_ibpb_inuse() Add brackets to the "else" clause in both check_ibrs_inuse() and clear_ibpb_inuse() to match indentations. The brackets are not required but may prevent a bug when indented code is mistakenly added without adding brackets. Orabug: 27625404 Signed-off-by: Chuck Anderson Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Darren Kenny --- diff --git a/arch/x86/include/asm/spec_ctrl.h b/arch/x86/include/asm/spec_ctrl.h index 91465ba903e0..963a382b82f0 100644 --- a/arch/x86/include/asm/spec_ctrl.h +++ b/arch/x86/include/asm/spec_ctrl.h @@ -235,11 +235,12 @@ static inline void clear_ibrs_inuse(void) static inline int check_ibrs_inuse(void) { - if (use_ibrs & SPEC_CTRL_IBRS_INUSE) + if (use_ibrs & SPEC_CTRL_IBRS_INUSE) { return 1; - else + } else { /* rmb to prevent wrong speculation for security */ rmb(); + } return 0; } @@ -308,11 +309,12 @@ static inline void clear_ibpb_inuse(void) static inline int check_ibpb_inuse(void) { - if (use_ibpb & SPEC_CTRL_IBPB_INUSE) + if (use_ibpb & SPEC_CTRL_IBPB_INUSE) { return 1; - else + } else { /* rmb to prevent wrong speculation for security */ rmb(); + } return 0; }