summaryrefslogtreecommitdiff
path: root/v4l
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-03-09 23:04:43 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-09 23:04:43 -0300
commit1dc806d561a18de7526fd0b710360fc3e5c14aa0 (patch)
tree049035fe2f194f3f9871d3e1dee1743d2d0554c4 /v4l
parenta9e5a96e3a38b1089b19496b26ebfd6d308d48e3 (diff)
parent74c1d5f410c25958fd587a05987e654bb9104d22 (diff)
downloadmediapointer-dvb-s2-1dc806d561a18de7526fd0b710360fc3e5c14aa0.tar.gz
mediapointer-dvb-s2-1dc806d561a18de7526fd0b710360fc3e5c14aa0.tar.bz2
merge: http://www.linuxtv.org/hg/~hverkuil/v4l-dvb-radio
From: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'v4l')
-rw-r--r--v4l/compat.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/v4l/compat.h b/v4l/compat.h
index 44878ce73..8e778d7f5 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -239,6 +239,12 @@ static inline int list_is_singular(const struct list_head *head)
min_t( __typeof__( x ), \
( h ), \
( x ) ) )
+#define clamp_val(val, min, max) ({ \
+ typeof(val) __val = (val); \
+ typeof(val) __min = (min); \
+ typeof(val) __max = (max); \
+ __val = __val < __min ? __min : __val; \
+ __val > __max ? __max : __val; })
#endif
#ifdef NEED_ALGO_CONTROL