Staging: wlags49_h2: fix spaces, macros and comments coding style issue in debug.h

This is a patch to the debug.h file that fixed up a TAB and spaces
Errors found by the checkpatch.pl tools, like
	spaces required around that '&' (ctx:VxV)
and
	ERROR: Invalid UTF-8, patch and commit message should be encoded in UTF-8
and
	do not use C99 // comments
and
	Macros with complex values should be enclosed in parenthesis

Signed-off-by: Ruslan Pisarev <ruslan@rpisarev.org.ua>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Ruslan Pisarev 2010-03-15 22:46:24 +02:00 committed by Greg Kroah-Hartman
parent 51b2a02869
commit b93634c4e3
1 changed files with 59 additions and 45 deletions

View File

@ -22,7 +22,7 @@
* software indicates your acceptance of these terms and conditions. If you do
* not agree with these terms and conditions, do not use the software.
*
* Copyright © 2003 Agere Systems Inc.
* Copyright (c) 2003 Agere Systems Inc.
* All rights reserved.
*
* Redistribution and use in source or binary forms, with or without
@ -70,7 +70,7 @@
#else
#undef DBG
#define DBG 1
#endif //DBG
#endif /* DBG */
@ -84,7 +84,7 @@
#ifndef DBG_LVL
#define DBG_LVL 5 /* yields nothing via init_module,
original value of 5 yields DBG_TRACE_ON and DBG_VERBOSE_ON */
#endif // DBG_LVL
#endif /* DBG_LVL*/
#define DBG_ERROR_ON 0x00000001L
@ -100,80 +100,94 @@
#define DBG_DEFAULTS (DBG_ERROR_ON | DBG_WARNING_ON | DBG_BREAK_ON)
#define DBG_FLAGS(A) (A)->DebugFlag
#define DBG_NAME(A) (A)->dbgName
#define DBG_LEVEL(A) (A)->dbgLevel
#define DBG_FLAGS(A) ((A)->DebugFlag)
#define DBG_NAME(A) ((A)->dbgName)
#define DBG_LEVEL(A) ((A)->dbgLevel)
#ifndef PRINTK
# define PRINTK(S...) printk(S)
#endif // PRINTK
#endif /* PRINTK */
#ifndef DBG_PRINT
# define DBG_PRINT(S...) PRINTK(KERN_DEBUG S)
#endif // DBG_PRINT
#endif /* DBG_PRINT */
#ifndef DBG_PRINTC
# define DBG_PRINTC(S...) PRINTK(S)
#endif // DBG_PRINTC
#endif /* DBG_PRINTC */
#ifndef DBG_TRAP
# define DBG_TRAP {}
#endif // DBG_TRAP
#endif /* DBG_TRAP */
#define _ENTER_STR ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
#define _LEAVE_STR "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
#define _DBG_ENTER(A) DBG_PRINT("%s:%.*s:%s\n",DBG_NAME(A),++DBG_LEVEL(A),_ENTER_STR,__FUNC__)
#define _DBG_LEAVE(A) DBG_PRINT("%s:%.*s:%s\n",DBG_NAME(A),DBG_LEVEL(A)--,_LEAVE_STR,__FUNC__)
#define _DBG_ENTER(A) DBG_PRINT("%s:%.*s:%s\n", DBG_NAME(A), ++DBG_LEVEL(A), _ENTER_STR, __FUNC__)
#define _DBG_LEAVE(A) DBG_PRINT("%s:%.*s:%s\n", DBG_NAME(A), DBG_LEVEL(A)--, _LEAVE_STR, __FUNC__)
#define DBG_FUNC(F) static const char *__FUNC__ = F;
#define DBG_ENTER(A) {if (DBG_FLAGS(A) & DBG_TRACE_ON) _DBG_ENTER(A);}
#define DBG_ENTER(A) {if (DBG_FLAGS(A) & DBG_TRACE_ON) \
_DBG_ENTER(A); }
#define DBG_LEAVE(A) {if (DBG_FLAGS(A) & DBG_TRACE_ON) _DBG_LEAVE(A);}
#define DBG_LEAVE(A) {if (DBG_FLAGS(A) & DBG_TRACE_ON) \
_DBG_LEAVE(A); }
#define DBG_PARAM(A,N,F,S...) {if (DBG_FLAGS(A) & DBG_PARAM_ON) \
DBG_PRINT(" %s -- "F"\n",N,S);}
#define DBG_PARAM(A, N, F, S...) {if (DBG_FLAGS(A) & DBG_PARAM_ON) \
DBG_PRINT(" %s -- "F"\n", N, S); }
#define DBG_ERROR(A,S...) {if (DBG_FLAGS(A) & DBG_ERROR_ON) \
{DBG_PRINT("%s:ERROR:%s ",DBG_NAME(A),__FUNC__);DBG_PRINTC(S);DBG_TRAP;}}
#define DBG_ERROR(A, S...) {if (DBG_FLAGS(A) & DBG_ERROR_ON) {\
DBG_PRINT("%s:ERROR:%s ", DBG_NAME(A), __FUNC__);\
DBG_PRINTC(S); \
DBG_TRAP; \
} \
}
#define DBG_WARNING(A,S...) {if (DBG_FLAGS(A) & DBG_WARNING_ON) \
{DBG_PRINT("%s:WARNING:%s ",DBG_NAME(A),__FUNC__);DBG_PRINTC(S);}}
#define DBG_WARNING(A, S...) {if (DBG_FLAGS(A) & DBG_WARNING_ON) {\
DBG_PRINT("%s:WARNING:%s ", DBG_NAME(A), __FUNC__);\
DBG_PRINTC(S); } }
#define DBG_NOTICE(A,S...) {if (DBG_FLAGS(A) & DBG_NOTICE_ON) \
{DBG_PRINT("%s:NOTICE:%s ",DBG_NAME(A),__FUNC__);DBG_PRINTC(S);}}
#define DBG_NOTICE(A, S...) {if (DBG_FLAGS(A) & DBG_NOTICE_ON) {\
DBG_PRINT("%s:NOTICE:%s ", DBG_NAME(A), __FUNC__);\
DBG_PRINTC(S); \
} \
}
#define DBG_TRACE(A,S...) do {if (DBG_FLAGS(A) & DBG_TRACE_ON) \
{DBG_PRINT("%s:%s ",DBG_NAME(A),__FUNC__);DBG_PRINTC(S);}} while (0)
#define DBG_TRACE(A, S...) do {if (DBG_FLAGS(A) & DBG_TRACE_ON) {\
DBG_PRINT("%s:%s ", DBG_NAME(A), __FUNC__);\
DBG_PRINTC(S); } } while (0)
#define DBG_RX(A,S...) {if (DBG_FLAGS(A) & DBG_RX_ON) \
{DBG_PRINT(S);}}
#define DBG_RX(A, S...) {if (DBG_FLAGS(A) & DBG_RX_ON) {\
DBG_PRINT(S); } }
#define DBG_TX(A,S...) {if (DBG_FLAGS(A) & DBG_TX_ON) \
{DBG_PRINT(S);}}
#define DBG_TX(A, S...) {if (DBG_FLAGS(A) & DBG_TX_ON) {\
DBG_PRINT(S); } }
#define DBG_DS(A,S...) {if (DBG_FLAGS(A) & DBG_DS_ON) \
{DBG_PRINT(S);}}
#define DBG_DS(A, S...) {if (DBG_FLAGS(A) & DBG_DS_ON) {\
DBG_PRINT(S); } }
#define DBG_ASSERT(C) {if (!(C)) \
{DBG_PRINT("ASSERT(%s) -- %s#%d (%s)\n", \
#C,__FILE__,__LINE__,__FUNC__); \
DBG_TRAP;}}
#define DBG_ASSERT(C) { \
if (!(C)) {\
DBG_PRINT("ASSERT(%s) -- %s#%d (%s)\n", \
#C, __FILE__, __LINE__, __FUNC__); \
DBG_TRAP; \
} \
}
typedef struct {
char *dbgName;
@ -183,7 +197,7 @@ typedef struct {
/****************************************************************************/
#else // DBG
#else /* DBG */
/****************************************************************************/
#define DBG_DEFN
@ -192,21 +206,21 @@ typedef struct {
#define DBG_PRINT(S...)
#define DBG_ENTER(A)
#define DBG_LEAVE(A)
#define DBG_PARAM(A,N,F,S...)
#define DBG_ERROR(A,S...)
#define DBG_WARNING(A,S...)
#define DBG_NOTICE(A,S...)
#define DBG_TRACE(A,S...)
#define DBG_RX(A,S...)
#define DBG_TX(A,S...)
#define DBG_DS(A,S...)
#define DBG_PARAM(A, N, F, S...)
#define DBG_ERROR(A, S...)
#define DBG_WARNING(A, S...)
#define DBG_NOTICE(A, S...)
#define DBG_TRACE(A, S...)
#define DBG_RX(A, S...)
#define DBG_TX(A, S...)
#define DBG_DS(A, S...)
#define DBG_ASSERT(C)
#endif // DBG
#endif /* DBG */
/****************************************************************************/
#endif // _DEBUG_H
#endif /* _DEBUG_H */