Make DebugPrintFuncSerial static

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Yuri Benditovich <yuri.benditovich@daynix.com>
This commit is contained in:
Frediano Ziglio 2016-09-12 14:47:16 +01:00
parent d86f38f89c
commit 9aaae88e4a
2 changed files with 11 additions and 14 deletions

View File

@ -741,13 +741,11 @@ DodSystemDisplayWrite(
#define RHEL_DEBUG_PORT ((PUCHAR)0x3F8) #define RHEL_DEBUG_PORT ((PUCHAR)0x3F8)
#define TEMP_BUFFER_SIZE 256 #define TEMP_BUFFER_SIZE 256
void DebugPrintFuncSerial(const char *format, ...) static void DebugPrintFuncSerial(const char *format, va_list list)
{ {
char buf[TEMP_BUFFER_SIZE]; char buf[TEMP_BUFFER_SIZE];
NTSTATUS status; NTSTATUS status;
size_t len; size_t len;
va_list list;
va_start(list, format);
status = RtlStringCbVPrintfA(buf, sizeof(buf), format, list); status = RtlStringCbVPrintfA(buf, sizeof(buf), format, list);
if (status == STATUS_SUCCESS) if (status == STATUS_SUCCESS)
{ {
@ -768,11 +766,17 @@ void DebugPrintFuncSerial(const char *format, ...)
void DebugPrint(int level, const char *fmt, ...) void DebugPrint(int level, const char *fmt, ...)
{ {
va_list list;
if (level <= nDebugLevel) {
va_start(list, fmt);
DebugPrintFuncSerial(fmt, list);
va_end(list);
}
static const ULONG xlate[] = { 0, 0, 1, 2, 3 }; static const ULONG xlate[] = { 0, 0, 1, 2, 3 };
if (level <= 0 || level > 5) if (level <= 0 || level > 5)
return; return;
va_list list;
va_start(list, fmt); va_start(list, fmt);
vDbgPrintEx(DPFLTR_IHVVIDEO_ID, xlate[level - 1], fmt, list); vDbgPrintEx(DPFLTR_IHVVIDEO_ID, xlate[level - 1], fmt, list);
va_end(list); va_end(list);

View File

@ -235,23 +235,16 @@ DodGetScanLine(
#if DBG #if DBG
extern int nDebugLevel; extern int nDebugLevel;
void DebugPrintFuncSerial(const char *format, ...);
void DebugPrint(int level, const char *fmt, ...); void DebugPrint(int level, const char *fmt, ...);
#define DbgExpandArguments(...) __VA_ARGS__ #define DbgExpandArguments(...) __VA_ARGS__
#define DbgPrint(level, line) do { \ #define DbgPrint(level, line) \
if (level <= nDebugLevel) DebugPrintFuncSerial line; \ DebugPrint(level, DbgExpandArguments line)
DebugPrint(level, DbgExpandArguments line); \
} while(0)
#else #else
#define DbgPrint(level, line) #define DbgPrint(level, line) {}
#endif #endif
// else if (0) DebugPrintFuncSerial line \
#ifndef TRACE_LEVEL_INFORMATION #ifndef TRACE_LEVEL_INFORMATION
#define TRACE_LEVEL_NONE 0 // Tracing is not on #define TRACE_LEVEL_NONE 0 // Tracing is not on
#define TRACE_LEVEL_FATAL 1 // Abnormal exit or termination #define TRACE_LEVEL_FATAL 1 // Abnormal exit or termination