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: <a8e1da0803090344l7f468326r8d3844e20ede08a3@mail.gmail.com>
Date:	Sun, 9 Mar 2008 18:44:10 +0800
From:	"Dave Young" <hidave.darkstar@...il.com>
To:	"Alan Cox" <alan@...rguk.ukuu.org.uk>
Cc:	"Johannes Weiner" <hannes@...urebad.de>, akpm@...ux-foundation.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] add time_now_after and other macros which compare with jiffies

On 3/9/08, Alan Cox <alan@...rguk.ukuu.org.uk> wrote:
> > >  > +/* time_now_before_eq(a) return true if now (jiffies) is before or equal to a */
>  > >  > +#define time_now_before_eq(a) time_before_eq(jiffies, a)
>  > >
>  > >  How about even more obvious names like time_is_past(), time_is_future(),
>  > >  ...?
>  >
>  > Thanks for comment.
>  >
>  > Then how do we name the _eq version?  IMHO, the time_now_* is enough.
>
>
> Why do you even need them. I don't see the point of *any* of these extra
>  macros as they simply obfuscate code and hide what is actually going on.
>  The initial macros were added because of the type safety and correct
>  comparison rules being complex. They have a purpose.

Yes, This has a purpose as well. You will find most of the usage of these
macros are just compare some value with jiffies after doing some grep.

For these cases this adding will easy use and understand.

>
>  Even if you want these you can use !time_future() if you don't want the
>  _eq variants. Generally speaking drivers should be using timers not
>  polled loops, and most of our loops comparing with jiffies want removing.
>

IMO time_after is a confusing name actually, If I don't read the comment I
will think it as time_future

To some extent I agree with you that the timer will be better.

>
>  Alan
>

Thanks
--
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