mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-10 07:10:27 +00:00
media: vivid: use time_is_after_jiffies() instead of open coding it
Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing <wangqing@vivo.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
parent
d613750ea3
commit
84db51f56f
@ -18,6 +18,7 @@
|
||||
#include <linux/freezer.h>
|
||||
#include <linux/random.h>
|
||||
#include <linux/v4l2-dv-timings.h>
|
||||
#include <linux/jiffies.h>
|
||||
#include <asm/div64.h>
|
||||
#include <media/videobuf2-vmalloc.h>
|
||||
#include <media/v4l2-dv-timings.h>
|
||||
@ -893,7 +894,7 @@ static int vivid_thread_vid_cap(void *data)
|
||||
next_jiffies_since_start = jiffies_since_start;
|
||||
|
||||
wait_jiffies = next_jiffies_since_start - jiffies_since_start;
|
||||
while (jiffies - cur_jiffies < wait_jiffies &&
|
||||
while (time_is_after_jiffies(cur_jiffies + wait_jiffies) &&
|
||||
!kthread_should_stop())
|
||||
schedule();
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <linux/freezer.h>
|
||||
#include <linux/random.h>
|
||||
#include <linux/v4l2-dv-timings.h>
|
||||
#include <linux/jiffies.h>
|
||||
#include <asm/div64.h>
|
||||
#include <media/videobuf2-vmalloc.h>
|
||||
#include <media/v4l2-dv-timings.h>
|
||||
@ -234,7 +235,7 @@ static int vivid_thread_vid_out(void *data)
|
||||
next_jiffies_since_start = jiffies_since_start;
|
||||
|
||||
wait_jiffies = next_jiffies_since_start - jiffies_since_start;
|
||||
while (jiffies - cur_jiffies < wait_jiffies &&
|
||||
while (time_is_after_jiffies(cur_jiffies + wait_jiffies) &&
|
||||
!kthread_should_stop())
|
||||
schedule();
|
||||
}
|
||||
|
@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include <linux/freezer.h>
|
||||
#include <linux/jiffies.h>
|
||||
#include "vivid-core.h"
|
||||
#include "vivid-kthread-touch.h"
|
||||
#include "vivid-touch-cap.h"
|
||||
@ -134,7 +135,7 @@ static int vivid_thread_touch_cap(void *data)
|
||||
next_jiffies_since_start = jiffies_since_start;
|
||||
|
||||
wait_jiffies = next_jiffies_since_start - jiffies_since_start;
|
||||
while (jiffies - cur_jiffies < wait_jiffies &&
|
||||
while (time_is_after_jiffies(cur_jiffies + wait_jiffies) &&
|
||||
!kthread_should_stop())
|
||||
schedule();
|
||||
}
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <media/v4l2-event.h>
|
||||
#include <media/v4l2-dv-timings.h>
|
||||
#include <linux/fixp-arith.h>
|
||||
#include <linux/jiffies.h>
|
||||
|
||||
#include "vivid-core.h"
|
||||
#include "vivid-ctrls.h"
|
||||
@ -205,7 +206,7 @@ static int vivid_thread_sdr_cap(void *data)
|
||||
next_jiffies_since_start = jiffies_since_start;
|
||||
|
||||
wait_jiffies = next_jiffies_since_start - jiffies_since_start;
|
||||
while (jiffies - cur_jiffies < wait_jiffies &&
|
||||
while (time_is_after_jiffies(cur_jiffies + wait_jiffies) &&
|
||||
!kthread_should_stop())
|
||||
schedule();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user