Skip to content
Snippets Groups Projects
Commit 100daf0c authored by scjody's avatar scjody
Browse files

Branch b1_4

Type-check arguments against format string in CDEBUG/CERROR, fix warnings
introduced.

b=12327
i=green
i=isaac
parent 1afca4bf
No related branches found
No related tags found
No related merge requests found
......@@ -466,34 +466,35 @@ struct libcfs_debug_msg_data {
extern int libcfs_debug_vmsg2(cfs_debug_limit_state_t *cdls,
int subsys, int mask,
const char *file, const char *fn, const int line,
const char *format1, va_list args,
const char *format2, ...);
#define libcfs_debug_vmsg(cdls, subsys, mask, file, fn, line, format, args) \
libcfs_debug_vmsg2(cdls, subsys, mask, file, fn, line, format, args, NULL, NULL)
#define libcfs_debug_msg(cdls, subsys, mask, file, fn, line, format, a...) \
libcfs_debug_vmsg2(cdls, subsys, mask, file, fn, line, NULL, NULL, format, ##a)
#define cdebug_va(cdls, mask, file, func, line, fmt, args) do { \
CHECK_STACK(); \
\
if (((mask) & D_CANTMASK) != 0 || \
((libcfs_debug & (mask)) != 0 && \
(libcfs_subsystem_debug & DEBUG_SUBSYSTEM) != 0)) \
libcfs_debug_vmsg(cdls, DEBUG_SUBSYSTEM, (mask), \
(file), (func), (line), fmt, args); \
const char *file, const char *fn, const int line,
const char *format1, va_list args,
const char *format2, ...)
__attribute__ ((format (printf, 9, 10)));
#define libcfs_debug_vmsg(cdls, subsys, mask, file, fn, line, format, args) \
libcfs_debug_vmsg2(cdls, subsys, mask, file, fn,line,format,args,NULL,NULL)
#define libcfs_debug_msg(cdls, subsys, mask, file, fn, line, format, a...) \
libcfs_debug_vmsg2(cdls, subsys, mask, file, fn,line,NULL,NULL,format, ##a)
#define cdebug_va(cdls, mask, file, func, line, fmt, args) do { \
CHECK_STACK(); \
\
if (((mask) & D_CANTMASK) != 0 || \
((libcfs_debug & (mask)) != 0 && \
(libcfs_subsystem_debug & DEBUG_SUBSYSTEM) != 0)) \
libcfs_debug_vmsg(cdls, DEBUG_SUBSYSTEM, (mask), \
(file), (func), (line), fmt, args); \
} while(0);
#define cdebug(cdls, mask, file, func, line, fmt, a...) do { \
CHECK_STACK(); \
\
if (((mask) & D_CANTMASK) != 0 || \
((libcfs_debug & (mask)) != 0 && \
(libcfs_subsystem_debug & DEBUG_SUBSYSTEM) != 0)) \
libcfs_debug_msg(cdls, DEBUG_SUBSYSTEM, (mask), \
(file), (func), (line), fmt, ## a); \
#define cdebug(cdls, mask, file, func, line, fmt, a...) do { \
CHECK_STACK(); \
\
if (((mask) & D_CANTMASK) != 0 || \
((libcfs_debug & (mask)) != 0 && \
(libcfs_subsystem_debug & DEBUG_SUBSYSTEM) != 0)) \
libcfs_debug_msg(cdls, DEBUG_SUBSYSTEM, (mask), \
(file), (func), (line), fmt, ## a); \
} while(0);
extern void libcfs_assertion_failed(const char *expr, const char *file,
......@@ -504,7 +505,7 @@ static inline void cfs_slow_warning(cfs_time_t now, int seconds, char *msg)
if (cfs_time_after(cfs_time_current(),
cfs_time_add(now, cfs_time_seconds(15))))
CERROR("slow %s %lu sec\n", msg,
cfs_duration_sec(cfs_time_sub(cfs_time_current(), now)));
cfs_duration_sec(cfs_time_sub(cfs_time_current(),now)));
}
/*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment