Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 259968
b: refs/heads/master
c: 213fd4a
h: refs/heads/master
v: v3
  • Loading branch information
matt mooney authored and Greg Kroah-Hartman committed Jul 6, 2011
1 parent 44e4d34 commit 59a511b
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 46 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9a20542fd252162673f3db6f62090688cc1baa72
refs/heads/master: 213fd4adcea93964f24376b6b82435d5495632a8
88 changes: 43 additions & 45 deletions trunk/drivers/staging/usbip/userspace/libsrc/usbip_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,51 +58,49 @@ extern int usbip_use_syslog;
extern int usbip_use_stderr;
extern int usbip_use_debug ;

#define err(fmt, args...) do { \
if (usbip_use_syslog) { \
syslog(LOG_ERR, "usbip err: %13s:%4d (%-12s) " fmt "\n", \
__FILE__, __LINE__, __FUNCTION__, ##args); \
} \
if (usbip_use_stderr) { \
fprintf(stderr, "usbip err: %13s:%4d (%-12s) " fmt "\n", \
__FILE__, __LINE__, __FUNCTION__, ##args); \
} \
} while (0)

#define notice(fmt, args...) do { \
if (usbip_use_syslog) { \
syslog(LOG_DEBUG, "usbip: " fmt, ##args); \
} \
if (usbip_use_stderr) { \
fprintf(stderr, "usbip: " fmt "\n", ##args); \
} \
} while (0)

#define info(fmt, args...) do { \
if (usbip_use_syslog) { \
syslog(LOG_DEBUG, fmt, ##args); \
} \
if (usbip_use_stderr) { \
fprintf(stderr, fmt "\n", ##args); \
} \
} while (0)

#define dbg(fmt, args...) do { \
if (usbip_use_debug) { \
if (usbip_use_syslog) { \
syslog(LOG_DEBUG, "usbip dbg: %13s:%4d (%-12s) " fmt, \
__FILE__, __LINE__, __FUNCTION__, ##args); \
} \
if (usbip_use_stderr) { \
fprintf(stderr, "usbip dbg: %13s:%4d (%-12s) " fmt "\n", \
__FILE__, __LINE__, __FUNCTION__, ##args); \
} \
} \
} while (0)


#define BUG() do { err("sorry, it's a bug"); abort(); } while (0)

#define PROGNAME "usbip"

#define pr_fmt(fmt) "%s: %s: " fmt "\n", PROGNAME
#define dbg_fmt(fmt) pr_fmt("%s:%d:[%s] " fmt), "debug", \
__FILE__, __LINE__, __FUNCTION__

#define err(fmt, args...) \
do { \
if (usbip_use_syslog) { \
syslog(LOG_ERR, pr_fmt(fmt), "error", ##args); \
} \
if (usbip_use_stderr) { \
fprintf(stderr, pr_fmt(fmt), "error", ##args); \
} \
} while (0)

#define info(fmt, args...) \
do { \
if (usbip_use_syslog) { \
syslog(LOG_INFO, pr_fmt(fmt), "info", ##args); \
} \
if (usbip_use_stderr) { \
fprintf(stderr, pr_fmt(fmt), "info", ##args); \
} \
} while (0)

#define dbg(fmt, args...) \
do { \
if (usbip_use_debug) { \
if (usbip_use_syslog) { \
syslog(LOG_DEBUG, dbg_fmt(fmt), ##args); \
} \
if (usbip_use_stderr) { \
fprintf(stderr, dbg_fmt(fmt), ##args); \
} \
} \
} while (0)

#define BUG() \
do { \
err("sorry, it's a bug!"); \
abort(); \
} while (0)

struct usbip_usb_interface {
uint8_t bInterfaceClass;
Expand Down

0 comments on commit 59a511b

Please sign in to comment.