All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@zip.com.au>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Oliver.Neukum@lrz.uni-muenchen.de, linux-kernel@vger.kernel.org
Subject: Re: ugly warnings with likely/unlikely
Date: Sun, 13 Jan 2002 12:12:20 -0800	[thread overview]
Message-ID: <3C41EA24.11494402@zip.com.au> (raw)
In-Reply-To: <16PjOb-0oLbCCC@fwd11.sul.t-online.com> from "Oliver Neukum" at Jan 13, 2002 01:05:13 PM <E16PmEA-0007Ai-00@the-village.bc.nu>

Alan Cox wrote:
> 
> > if (likely(stru->pointer))
> >
> > results in an ugly warning about using pointer as int.
> > Is there something that could be done against that ?
> 
>         if (likely(stru->pointer == NULL))
> 

-#define likely(x)       __builtin_expect((x),1)
-#define unlikely(x)     __builtin_expect((x),0)
+#define likely(x)       __builtin_expect((x)!=0,1)
+#define unlikely(x)     __builtin_expect((x)!=0,0)

?

  parent reply	other threads:[~2002-01-13 20:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-13 12:05 ugly warnings with likely/unlikely Oliver Neukum
2002-01-13 15:07 ` Alan Cox
2002-01-13 15:06   ` Oliver Neukum
2002-01-13 20:12   ` Andrew Morton [this message]
     [not found] <16PjOb-0oLbCCC@fwd11.sul.t-online.com.suse.lists.linux.kernel>
2002-01-13 17:27 ` Andi Kleen
2002-01-13 18:26   ` Robert Love

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=3C41EA24.11494402@zip.com.au \
    --to=akpm@zip.com.au \
    --cc=Oliver.Neukum@lrz.uni-muenchen.de \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.