lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20060715.181917.71091405.davem@davemloft.net>
Date:	Sat, 15 Jul 2006 18:19:17 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	davej@...hat.com
Cc:	herbert@...dor.apana.org.au, akpm@...l.org,
	linux-kernel@...r.kernel.org
Subject: Re: 2.6.18-rc1-mm2

From: Dave Jones <davej@...hat.com>
Date: Sat, 15 Jul 2006 02:04:00 -0400

> Ick, nasty.  Seems there's quite a few instances of that construct around.

The cases you grepped out here all seem to be OK to my eyes.
They fall into two categories of legitimate uses:

1) The return value really is a boolean, 0 or 1, so using
   likely/unlikely around it is fine.

   In fact, for a inline function returning a boolean, this
   is a way to get the likely'ness to propagate into a test
   done by the caller.

2) The likely() is part of some real check such as:

   return (likely(test_val) ? x : y);

   which is also fine.

Like I said, the bad case is only when the unlikely() or likely()
surrounds an expression that is not expected to evaluate to
a boolean.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ