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] [thread-next>] [day] [month] [year] [list]
Message-ID: <a8e1da0803121744m1ebe0025hc323c699e5f5d9a0@mail.gmail.com>
Date:	Thu, 13 Mar 2008 08:44:48 +0800
From:	"Dave Young" <hidave.darkstar@...il.com>
To:	"Johannes Weiner" <hannes@...urebad.de>
Cc:	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
	"Marcin Slusarz" <marcin.slusarz@...il.com>,
	paulmck@...ux.vnet.ibm.com
Subject: Re: [PATCH -mm] do not check condition twice in WARN_ON_SECS

On Wed, Mar 12, 2008 at 9:47 PM, Johannes Weiner <hannes@...urebad.de> wrote:
> Hi Dave,
>
>
>
>  Dave Young <hidave.darkstar@...il.com> writes:
>
>  > Don't check condition twice, change WARN_ON(condition) to WARN_ON(1)
>  > Thanks Marcin Slusarz <marcin.slusarz@...il.com> for pointing out
>  >
>  > Signed-off-by: Dave Young <hidave.darkstar@...il.com>
>  >
>  > ---
>  > include/asm-generic/bug.h |    3 ++-
>  > 1 file changed, 2 insertions(+), 1 deletion(-)
>  >
>  > diff -upr linux/include/asm-generic/bug.h linux.new/include/asm-generic/bug.h
>  > --- linux/include/asm-generic/bug.h   2008-03-12 08:45:08.000000000 +0800
>  > +++ linux.new/include/asm-generic/bug.h       2008-03-12 09:04:07.000000000 +0800
>  > @@ -80,7 +80,8 @@ extern void warn_on_slowpath(const char
>  >       int __ret_warn_on = !!(condition);                      \
>  >       if (unlikely(__ret_warn_on))                            \
>  >               if (__ratelimit(secs * HZ, 1))                  \
>  > -                     WARN_ON(condition);                     \
>  > +                     WARN_ON(1);                             \
>  > +     unlikely(__ret_warn_on);                                \
>  >  })
>
>  What's wrong with:
>
>  #define WARN_ON_SECS(condition, secs) \
>         WARN_ON(condition && __ratelimit(secs * HZ, 1))

Looks concise.
Should I update the third time?
--
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