From: Waldemar Kozaczuk <[email protected]>
Committer: WALDEMAR KOZACZUK <[email protected]>
Branch: master

ena_log: adapt to OSv by switching to tprintf()

Signed-off-by: Waldemar Kozaczuk <[email protected]>

---
diff --git a/bsd/sys/contrib/ena_com/ena_fbsd_log.h 
b/bsd/sys/contrib/ena_com/ena_fbsd_log.h
--- a/bsd/sys/contrib/ena_com/ena_fbsd_log.h
+++ b/bsd/sys/contrib/ena_com/ena_fbsd_log.h
@@ -43,22 +43,29 @@ enum ena_log_t {
 
 extern int ena_log_level;
 
+#define ena_log_unused(dev, level, fmt, args...)               \
+       do {                                                    \
+       } while (0)
+
+#ifdef ENA_LOG_ENABLE
 #define ena_log(dev, level, fmt, args...)                      \
        do {                                                    \
                if (ENA_ ## level <= ena_log_level)             \
-                       device_printf((dev), fmt, ##args);      \
+                       tprintf("ena", logger_debug, fmt, ##args);\
        } while (0)
 
 #define ena_log_raw(level, fmt, args...)                       \
        do {                                                    \
                if (ENA_ ## level <= ena_log_level)             \
                        printf(fmt, ##args);                    \
        } while (0)
+#else
+#define ena_log(dev, level, fmt, args...)                      \
+       ena_log_unused((dev), level, fmt, ##args)
 
-#define ena_log_unused(dev, level, fmt, args...)               \
-       do {                                                    \
-               (void)(dev);                                    \
-       } while (0)
+#define ena_log_raw(level, fmt, args...)                       \
+       ena_log_unused((dev), level, fmt, ##args)
+#endif
 
 #ifdef ENA_LOG_IO_ENABLE
 #define ena_log_io(dev, level, fmt, args...)                   \

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/0000000000004fc120060eaf14c4%40google.com.

Reply via email to