diff options
author | Andreas Mohr <andi@lisas.de> | 2009-09-14 18:13:29 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-09-18 23:52:18 -0400 |
commit | 607cfab6e7bce8049e61795e86f9bbbe07abd514 (patch) | |
tree | 5b5b6469a3c569f102cd7b6ec314fe2388072349 /drivers/media/video | |
parent | 6c119ff493039af862ae57d88d52b4383c9d8ece (diff) |
V4L/DVB (13003): Correct dangerous and inefficient msecs_to_jiffies() calculation in some V4L2 drivers
Signed-off-by: Andreas Mohr <andi@lisas.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/et61x251/et61x251_core.c | 6 | ||||
-rw-r--r-- | drivers/media/video/sn9c102/sn9c102_core.c | 6 | ||||
-rw-r--r-- | drivers/media/video/zc0301/zc0301_core.c | 6 |
3 files changed, 12 insertions, 6 deletions
diff --git a/drivers/media/video/et61x251/et61x251_core.c b/drivers/media/video/et61x251/et61x251_core.c index d1c1e457f0b9..74092f436be6 100644 --- a/drivers/media/video/et61x251/et61x251_core.c +++ b/drivers/media/video/et61x251/et61x251_core.c | |||
@@ -1379,8 +1379,10 @@ et61x251_read(struct file* filp, char __user * buf, | |||
1379 | (!list_empty(&cam->outqueue)) || | 1379 | (!list_empty(&cam->outqueue)) || |
1380 | (cam->state & DEV_DISCONNECTED) || | 1380 | (cam->state & DEV_DISCONNECTED) || |
1381 | (cam->state & DEV_MISCONFIGURED), | 1381 | (cam->state & DEV_MISCONFIGURED), |
1382 | cam->module_param.frame_timeout * | 1382 | msecs_to_jiffies( |
1383 | 1000 * msecs_to_jiffies(1) ); | 1383 | cam->module_param.frame_timeout * 1000 |
1384 | ) | ||
1385 | ); | ||
1384 | if (timeout < 0) { | 1386 | if (timeout < 0) { |
1385 | mutex_unlock(&cam->fileop_mutex); | 1387 | mutex_unlock(&cam->fileop_mutex); |
1386 | return timeout; | 1388 | return timeout; |
diff --git a/drivers/media/video/sn9c102/sn9c102_core.c b/drivers/media/video/sn9c102/sn9c102_core.c index 23edfdc4d4bc..9d84c94e8a40 100644 --- a/drivers/media/video/sn9c102/sn9c102_core.c +++ b/drivers/media/video/sn9c102/sn9c102_core.c | |||
@@ -1954,8 +1954,10 @@ sn9c102_read(struct file* filp, char __user * buf, size_t count, loff_t* f_pos) | |||
1954 | (!list_empty(&cam->outqueue)) || | 1954 | (!list_empty(&cam->outqueue)) || |
1955 | (cam->state & DEV_DISCONNECTED) || | 1955 | (cam->state & DEV_DISCONNECTED) || |
1956 | (cam->state & DEV_MISCONFIGURED), | 1956 | (cam->state & DEV_MISCONFIGURED), |
1957 | cam->module_param.frame_timeout * | 1957 | msecs_to_jiffies( |
1958 | 1000 * msecs_to_jiffies(1) ); | 1958 | cam->module_param.frame_timeout * 1000 |
1959 | ) | ||
1960 | ); | ||
1959 | if (timeout < 0) { | 1961 | if (timeout < 0) { |
1960 | mutex_unlock(&cam->fileop_mutex); | 1962 | mutex_unlock(&cam->fileop_mutex); |
1961 | return timeout; | 1963 | return timeout; |
diff --git a/drivers/media/video/zc0301/zc0301_core.c b/drivers/media/video/zc0301/zc0301_core.c index 96971044fc78..b3c6436b33ba 100644 --- a/drivers/media/video/zc0301/zc0301_core.c +++ b/drivers/media/video/zc0301/zc0301_core.c | |||
@@ -819,8 +819,10 @@ zc0301_read(struct file* filp, char __user * buf, size_t count, loff_t* f_pos) | |||
819 | (!list_empty(&cam->outqueue)) || | 819 | (!list_empty(&cam->outqueue)) || |
820 | (cam->state & DEV_DISCONNECTED) || | 820 | (cam->state & DEV_DISCONNECTED) || |
821 | (cam->state & DEV_MISCONFIGURED), | 821 | (cam->state & DEV_MISCONFIGURED), |
822 | cam->module_param.frame_timeout * | 822 | msecs_to_jiffies( |
823 | 1000 * msecs_to_jiffies(1) ); | 823 | cam->module_param.frame_timeout * 1000 |
824 | ) | ||
825 | ); | ||
824 | if (timeout < 0) { | 826 | if (timeout < 0) { |
825 | mutex_unlock(&cam->fileop_mutex); | 827 | mutex_unlock(&cam->fileop_mutex); |
826 | return timeout; | 828 | return timeout; |