]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blob - drivers/media/platform/s5p-mfc/s5p_mfc_debug.h
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
[mirror_ubuntu-hirsute-kernel.git] / drivers / media / platform / s5p-mfc / s5p_mfc_debug.h
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * drivers/media/platform/s5p-mfc/s5p_mfc_debug.h
4 *
5 * Header file for Samsung MFC (Multi Function Codec - FIMV) driver
6 * This file contains debug macros
7 *
8 * Kamil Debski, Copyright (c) 2011 Samsung Electronics
9 * http://www.samsung.com/
10 */
11
12 #ifndef S5P_MFC_DEBUG_H_
13 #define S5P_MFC_DEBUG_H_
14
15 #define DEBUG
16
17 #ifdef DEBUG
18 extern int mfc_debug_level;
19
20 #define mfc_debug(level, fmt, args...) \
21 do { \
22 if (mfc_debug_level >= level) \
23 printk(KERN_DEBUG "%s:%d: " fmt, \
24 __func__, __LINE__, ##args); \
25 } while (0)
26 #else
27 #define mfc_debug(level, fmt, args...)
28 #endif
29
30 #define mfc_debug_enter() mfc_debug(5, "enter\n")
31 #define mfc_debug_leave() mfc_debug(5, "leave\n")
32
33 #define mfc_err(fmt, args...) \
34 do { \
35 printk(KERN_ERR "%s:%d: " fmt, \
36 __func__, __LINE__, ##args); \
37 } while (0)
38
39 #define mfc_err_limited(fmt, args...) \
40 do { \
41 printk_ratelimited(KERN_ERR "%s:%d: " fmt, \
42 __func__, __LINE__, ##args); \
43 } while (0)
44
45 #define mfc_info(fmt, args...) \
46 do { \
47 printk(KERN_INFO "%s:%d: " fmt, \
48 __func__, __LINE__, ##args); \
49 } while (0)
50
51 #endif /* S5P_MFC_DEBUG_H_ */