From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751794AbcAPNBj (ORCPT ); Sat, 16 Jan 2016 08:01:39 -0500 Received: from mail-lf0-f50.google.com ([209.85.215.50]:33176 "EHLO mail-lf0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751257AbcAPNBh (ORCPT ); Sat, 16 Jan 2016 08:01:37 -0500 From: Alexander Kuleshov To: Thomas Gleixner Cc: Ingo Molnar , "H . Peter Anvin" , x86@kernel.org, Borislav Petkov , Andy Lutomirski , Dave Hansen , Wang Nan , linux-kernel@vger.kernel.org, Alexander Kuleshov Subject: [PATCH] x86/traps: use conditional_{cli,sti} in preempt_conditinal_{cli_sti} Date: Sat, 16 Jan 2016 18:58:07 +0600 Message-Id: <1452949087-14855-1-git-send-email-kuleshovmail@gmail.com> X-Mailer: git-send-email 2.7.0.25.gfc10eb5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The 3d2a71a596bd9 commit (x86, traps: converge do_debug handlers by Alexander van Heukelum ) introduces two functions: preempt_conditional_sti/cli() which are enables/disables interrupts depends on state of the interrupt enable flag and increments/decrements the preempt counter. In the same time arch/x86/kernel/traps.c defines two similar inline functions: conditional_{sti,cli} which are do the same, but without touch of the preempt counter. Let's use these functions in the preempt_conditional_{sti,cli} instead of duplication of 'if' statemets. Signed-off-by: Alexander Kuleshov --- arch/x86/kernel/traps.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index ade185a..30ec8fa 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c @@ -92,8 +92,7 @@ static inline void conditional_sti(struct pt_regs *regs) static inline void preempt_conditional_sti(struct pt_regs *regs) { preempt_count_inc(); - if (regs->flags & X86_EFLAGS_IF) - local_irq_enable(); + conditional_sti(regs); } static inline void conditional_cli(struct pt_regs *regs) @@ -104,8 +103,7 @@ static inline void conditional_cli(struct pt_regs *regs) static inline void preempt_conditional_cli(struct pt_regs *regs) { - if (regs->flags & X86_EFLAGS_IF) - local_irq_disable(); + conditional_cli(regs); preempt_count_dec(); } -- 2.7.0.25.gfc10eb5