mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Geunsik Lim <geunsik.lim@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Fix logical and operator at interrupt handler thread
Date: Wed, 01 Feb 2012 06:41:31 +0100	[thread overview]
Message-ID: <1328074891.2617.45.camel@edumazet-laptop> (raw)
In-Reply-To: <1328073594-16673-1-git-send-email-geunsik.lim@gmail.com>

Le mercredi 01 février 2012 à 14:19 +0900, Geunsik Lim a écrit :
> From: Geunsik Lim <geunsik.lim@samsung.com>
> 
> '&' is a bitwise operation. (e.g: a & b )
> Use '&&' and-operator instead of '&' bitwise operator.
> 
> Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
> ---
>  kernel/irq/manage.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
> index a9a9dbe..c0730ad 100644
> --- a/kernel/irq/manage.c
> +++ b/kernel/irq/manage.c
> @@ -773,7 +773,7 @@ static int irq_thread(void *data)
>  			struct irqaction *action);
>  	int wake;
>  
> -	if (force_irqthreads & test_bit(IRQTF_FORCED_THREAD,
> +	if (force_irqthreads && test_bit(IRQTF_FORCED_THREAD,
>  					&action->thread_flags))
>  		handler_fn = irq_forced_thread_fn;
>  	else


This was intentional, to have a single conditional move :

ffffffff810b0868:       0f b6 15 19 f5 bd 00    movzbl 0xbdf519(%rip),%edx        # ffffffff81c8fd88 <force_irqthreads>
ffffffff810b086f:       49 89 c5                mov    %rax,%r13
ffffffff810b0872:       48 8b 43 40             mov    0x40(%rbx),%rax
ffffffff810b0876:       be 01 00 00 00          mov    $0x1,%esi
ffffffff810b087b:       48 c1 e8 04             shr    $0x4,%rax
ffffffff810b087f:       85 c2                   test   %eax,%edx
ffffffff810b0881:       48 c7 c0 80 0a 0b 81    mov    $0xffffffff810b0a80,%rax
ffffffff810b0888:       48 c7 c2 40 dc 80 81    mov    $0xffffffff8180dc40,%rdx
ffffffff810b088f:       4c 0f 44 f8             cmove  %rax,%r15


I guess you could instead use jump_label here to shorten the code.





  reply	other threads:[~2012-02-01  5:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-01  5:19 Geunsik Lim
2012-02-01  5:41 ` Eric Dumazet [this message]
2012-02-01  5:53   ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1328074891.2617.45.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=geunsik.lim@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®