summaryrefslogtreecommitdiff
path: root/uvc-gadget.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-05-21 21:43:21 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-05-21 21:43:21 +0300
commitb28524b5eff7d61670a2f1794ea316dc66392315 (patch)
tree588488dce2206abf8195c19a21ba430740d3c7b9 /uvc-gadget.c
parent349679083d1f1053ee79cc933e0e41c48ce05fb9 (diff)
uvc-gadget: Use macros from tools.h
The tools.h header defines clamp and ARRAY_SIZE macros. Use the header to replace the private implementation. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'uvc-gadget.c')
-rw-r--r--uvc-gadget.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/uvc-gadget.c b/uvc-gadget.c
index 7d6c20a..12a361d 100644
--- a/uvc-gadget.c
+++ b/uvc-gadget.c
@@ -39,21 +39,11 @@
#include <linux/videodev2.h>
#include "events.h"
+#include "tools.h"
#define UVC_INTF_CONTROL 0
#define UVC_INTF_STREAMING 1
-#define clamp(val, min, max) ({ \
- typeof(val) __val = (val); \
- typeof(min) __min = (min); \
- typeof(max) __max = (max); \
- (void) (&__val == &__min); \
- (void) (&__val == &__max); \
- __val = __val < __min ? __min: __val; \
- __val > __max ? __max: __val; })
-
-#define ARRAY_SIZE(a) ((sizeof(a) / sizeof(a[0])))
-
struct uvc_device
{
int fd;