pc_serial: cleanup, no functional changes

- Improve readability of code to detect serial debug
- Rename usb_serial_* functions to pc_serial_* (code was copied from the
  USB serial driver)
This commit is contained in:
Adrien Destugues 2017-06-25 07:54:02 +02:00
parent af5001925e
commit bb0d0ea2e3
3 changed files with 7 additions and 9 deletions

View File

@ -524,9 +524,7 @@ scan_isa_hardcoded()
{
#ifdef HANDLE_ISA_COM
int i;
bool serialDebug = true;
serialDebug = get_safemode_boolean("serial_debug_output", serialDebug);
bool serialDebug = get_safemode_boolean("serial_debug_output", true);
for (i = 0; i < 4; i++) {
// skip the port used for kernel debugging...

View File

@ -70,7 +70,7 @@ create_log_file()
void
usb_serial_trace(bool force, const char *format, ...)
pc_serial_trace(bool force, const char *format, ...)
{
if (!gLogEnabled && !force)
return;

View File

@ -10,20 +10,20 @@
void load_settings();
void create_log_file();
void usb_serial_trace(bool force, const char *format, ...);
void pc_serial_trace(bool force, const char *format, ...);
#define TRACE_ALWAYS(x...) usb_serial_trace(true, x);
#define TRACE(x...) usb_serial_trace(false, x);
#define TRACE_ALWAYS(x...) pc_serial_trace(true, x);
#define TRACE(x...) pc_serial_trace(false, x);
extern bool gLogFunctionCalls;
#define TRACE_FUNCALLS(x...) \
if (gLogFunctionCalls) \
usb_serial_trace(false, x);
pc_serial_trace(false, x);
extern bool gLogFunctionReturns;
#define TRACE_FUNCRET(x...) \
if (gLogFunctionReturns) \
usb_serial_trace(false, x);
pc_serial_trace(false, x);
extern bool gLogFunctionResults;
#define TRACE_FUNCRES(func, param) \