On 5/16/23 18:02, Damien Le Moal wrote:
On 5/17/23 07:33, Bart Van Assche wrote:
- if (time_after_eq(jiffies, (unsigned long)rq->fifo_time))
- return 1;
-
- return 0;
+ return time_is_before_eq_jiffies((unsigned long)rq->fifo_time);
This looks wrong: isn't this reversing the return value ?
Shouldn't this be:
return time_after_eq(jiffies, (unsigned long)rq->fifo_time));
To return true if the first request in fifo list *expired* as indicated by the
function kdoc comment.
Hi Damien,
From include/linux/jiffies.h:
#define time_is_before_eq_jiffies(a) time_after_eq(jiffies, a)
Hence, time_is_before_eq_jiffies((unsigned long)rq->fifo_time) is
equivalent to time_after_eq(jiffies, (unsigned long)rq->fifo_time). Both
expressions check whether or not rq->fifo_time is in the past.
Bart.