• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * Copyright (c) 2023 Huawei Device Co., Ltd.
4  */
5 
6 #ifndef _XPM_LOG_H
7 #define _XPM_LOG_H
8 
9 #define XPM_CHECK_FAILED (-1024)
10 
11 #define XPM_TAG "xpm_kernel"
12 #define XPM_INFO_TAG  "I"
13 #define XPM_ERROR_TAG "E"
14 #define XPM_DEBUG_TAG "D"
15 
16 #define xpm_log_info(fmt, args...) pr_info("[%s/%s]%s: " fmt "\n", \
17 	XPM_INFO_TAG, XPM_TAG, __func__, ##args)
18 
19 #define xpm_log_error(fmt, args...) pr_err("[%s/%s]%s: " fmt "\n", \
20 	XPM_ERROR_TAG, XPM_TAG, __func__, ##args)
21 
22 #ifdef CONFIG_SECURITY_XPM_DEBUG
23 #define xpm_log_debug(fmt, args...) pr_info("[%s/%s]%s: " fmt "\n", \
24 	XPM_DEBUG_TAG, XPM_TAG, __func__, ##args)
25 #else
26 #define xpm_log_debug(fmt, args...) no_printk(fmt, ##args)
27 #endif
28 
29 #endif /* _XPM_LOG_H */
30