isl: Make isl_finishme only warn once per call-site
authorEmil Velikov <emil.velikov@collabora.com>
Thu, 24 Nov 2016 18:18:15 +0000 (18:18 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 28 Nov 2016 19:12:49 +0000 (19:12 +0000)
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
src/intel/isl/isl_priv.h

index dc3975d3ca842e1d71e240bef7203c184310947f..1867d258822430d277531b14537a6aed4ae690d9 100644 (file)
 #include "isl.h"
 
 #define isl_finishme(format, ...) \
-   __isl_finishme(__FILE__, __LINE__, format, ##__VA_ARGS__)
+   do { \
+      static bool reported = false; \
+      if (!reported) { \
+         __isl_finishme(__FILE__, __LINE__, format, ##__VA_ARGS__); \
+         reported = true; \
+      } \
+   } while (0)
 
 void PRINTFLIKE(3, 4) UNUSED
 __isl_finishme(const char *file, int line, const char *fmt, ...);