From b28524b5eff7d61670a2f1794ea316dc66392315 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 21 May 2018 21:43:21 +0300 Subject: 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 --- uvc-gadget.c | 12 +----------- 1 file changed, 1 insertion(+), 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 #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; -- cgit v1.2.3