public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* bug in jiffy time comparison macros
@ 2008-06-11  0:29 Ralph Campbell
  2008-06-11  2:51 ` Johannes Weiner
  0 siblings, 1 reply; 2+ messages in thread
From: Ralph Campbell @ 2008-06-11  0:29 UTC (permalink / raw)
  To: linux-kernel

It may just be me :-) but this looks like a bug:
In the current include/linux/jiffies.h:

#define time_before(a,b)        time_after(b,a)

Shouldn't this be:

#define time_before(a,b)        time_after_eq(b,a)

There are a number of similar macros which fail
to change before to after_eq, or before_eq to after,
etc.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: bug in jiffy time comparison macros
  2008-06-11  0:29 bug in jiffy time comparison macros Ralph Campbell
@ 2008-06-11  2:51 ` Johannes Weiner
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Weiner @ 2008-06-11  2:51 UTC (permalink / raw)
  To: Ralph Campbell; +Cc: linux-kernel

Hi,

Ralph Campbell <ralph.campbell@qlogic.com> writes:

> It may just be me :-) but this looks like a bug:
> In the current include/linux/jiffies.h:
>
> #define time_before(a,b)        time_after(b,a)
>
> Shouldn't this be:
>
> #define time_before(a,b)        time_after_eq(b,a)

Then it would be time_before_eq()..?

If a is before b, b must be after a.  If they might be equal, than from
both points of view.

	Hannes

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-06-11  2:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-11  0:29 bug in jiffy time comparison macros Ralph Campbell
2008-06-11  2:51 ` Johannes Weiner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox