From a692df46c1b016058fd3c1883f984236cffa257b Mon Sep 17 00:00:00 2001 From: Sun Peng Date: Fri, 28 Aug 2020 05:18:52 +0000 Subject: [PATCH] dm: tpm: Convert print output to acrn-dm logger Refine the DPRINTF/WPRINTF to pr_* based log interface for better log management. Tracked-On: #5267 Signed-off-by: Sun Peng Reviewed-by: Chi Mingqiang Acked-by: Wang, Yu1 --- devicemodel/hw/platform/tpm/tpm.c | 5 +++-- devicemodel/hw/platform/tpm/tpm_crb.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/devicemodel/hw/platform/tpm/tpm.c b/devicemodel/hw/platform/tpm/tpm.c index cbd1e7a48..c7515116a 100644 --- a/devicemodel/hw/platform/tpm/tpm.c +++ b/devicemodel/hw/platform/tpm/tpm.c @@ -13,13 +13,14 @@ #include "vmmapi.h" #include "tpm.h" #include "tpm_internal.h" +#include "log.h" static int tpm_debug; #define LOG_TAG "tpm: " #define DPRINTF(fmt, args...) \ - do { if (tpm_debug) printf(LOG_TAG "%s:" fmt, __func__, ##args); } while (0) + do { if (tpm_debug) pr_dbg(LOG_TAG "%s:" fmt, __func__, ##args); } while (0) #define WPRINTF(fmt, args...) \ - do { printf(LOG_TAG "%s:" fmt, __func__, ##args); } while (0) + do { pr_err(LOG_TAG "%s:" fmt, __func__, ##args); } while (0) #define STR_MAX_LEN 1024U static char *sock_path = NULL; diff --git a/devicemodel/hw/platform/tpm/tpm_crb.c b/devicemodel/hw/platform/tpm/tpm_crb.c index e37705211..2b22e070e 100644 --- a/devicemodel/hw/platform/tpm/tpm_crb.c +++ b/devicemodel/hw/platform/tpm/tpm_crb.c @@ -17,13 +17,14 @@ #include "mem.h" #include "tpm.h" #include "tpm_internal.h" +#include "log.h" static int tpm_crb_debug; #define LOG_TAG "tpm_crb: " #define DPRINTF(fmt, args...) \ - do { if (tpm_crb_debug) printf(LOG_TAG "%s: " fmt, __func__, ##args); } while (0) + do { if (tpm_crb_debug) pr_dbg(LOG_TAG "%s: " fmt, __func__, ##args); } while (0) #define WPRINTF(fmt, args...) \ - do { printf(LOG_TAG "%s: " fmt, __func__, ##args); } while (0) + do { pr_err(LOG_TAG "%s: " fmt, __func__, ##args); } while (0) #define __packed __attribute__((packed))