1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 2975f14faSJiri Olsa #ifndef __API_DEBUG_INTERNAL_H__ 3975f14faSJiri Olsa #define __API_DEBUG_INTERNAL_H__ 4975f14faSJiri Olsa 5975f14faSJiri Olsa #include "debug.h" 6975f14faSJiri Olsa 7975f14faSJiri Olsa #define __pr(func, fmt, ...) \ 8975f14faSJiri Olsa do { \ 9975f14faSJiri Olsa if ((func)) \ 10975f14faSJiri Olsa (func)("libapi: " fmt, ##__VA_ARGS__); \ 11975f14faSJiri Olsa } while (0) 12975f14faSJiri Olsa 13*c405c37bSKefeng Wang extern libapi_print_fn_t __pr_warn; 14975f14faSJiri Olsa extern libapi_print_fn_t __pr_info; 15975f14faSJiri Olsa extern libapi_print_fn_t __pr_debug; 16975f14faSJiri Olsa 17*c405c37bSKefeng Wang #define pr_warn(fmt, ...) __pr(__pr_warn, fmt, ##__VA_ARGS__) 18975f14faSJiri Olsa #define pr_info(fmt, ...) __pr(__pr_info, fmt, ##__VA_ARGS__) 19975f14faSJiri Olsa #define pr_debug(fmt, ...) __pr(__pr_debug, fmt, ##__VA_ARGS__) 20975f14faSJiri Olsa 21975f14faSJiri Olsa #endif /* __API_DEBUG_INTERNAL_H__ */ 22