Squashed backup commit (no shallow-clone history issues) of xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2 branch, upstream commit 9eece662e) plus all fixes applied to get everpal_defconfig building clean against a modern (GCC 15.2.0) toolchain -- see the previous commit message on the lineage-23.2 branch (also in this repo history is not available here since this is a squashed snapshot; full incremental history lives in the local DL380 checkout and the upstream GitHub remote). Upstream: https://github.com/xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2)
68 lines
1.5 KiB
C
68 lines
1.5 KiB
C
/*
|
|
* Copyright (C) 2015 MediaTek Inc.
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*/
|
|
|
|
#include "conn_md_log.h"
|
|
|
|
int g_conn_md_dbg_lvl = CONN_MD_LOG_INFO;
|
|
|
|
/*Log defination*/
|
|
int __conn_md_log_print(const char *str, ...)
|
|
{
|
|
va_list args;
|
|
char temp_sring[DBG_LOG_STR_SIZE];
|
|
int ret;
|
|
|
|
va_start(args, str);
|
|
ret = vsnprintf(temp_sring, DBG_LOG_STR_SIZE, str, args);
|
|
va_end(args);
|
|
|
|
if (ret > 0)
|
|
pr_info("%s", temp_sring);
|
|
|
|
return ret;
|
|
}
|
|
|
|
int __conn_md_get_log_lvl(void)
|
|
{
|
|
/* return CONN_MD_LOG_INFO; */
|
|
return g_conn_md_dbg_lvl;
|
|
|
|
}
|
|
|
|
#define CONN_MD_LOG_LOUD 4
|
|
#define CONN_MD_LOG_DBG 3
|
|
#define CONN_MD_LOG_INFO 2
|
|
#define CONN_MD_LOG_WARN 1
|
|
#define CONN_MD_LOG_ERR 0
|
|
|
|
int conn_md_log_set_lvl(int log_lvl)
|
|
{
|
|
/* return CONN_MD_LOG_INFO; */
|
|
g_conn_md_dbg_lvl = log_lvl;
|
|
|
|
if (g_conn_md_dbg_lvl > CONN_MD_LOG_LOUD) {
|
|
CONN_MD_ERR_FUNC("log_lvl(%d) is too big, round to %d\n",
|
|
log_lvl, CONN_MD_LOG_LOUD);
|
|
g_conn_md_dbg_lvl = CONN_MD_LOG_LOUD;
|
|
}
|
|
|
|
if (g_conn_md_dbg_lvl < CONN_MD_LOG_ERR) {
|
|
CONN_MD_ERR_FUNC("log_lvl(%d) is too small, round to %d\n",
|
|
log_lvl, CONN_MD_LOG_ERR);
|
|
g_conn_md_dbg_lvl = CONN_MD_LOG_ERR;
|
|
}
|
|
|
|
return g_conn_md_dbg_lvl;
|
|
|
|
}
|