1
0
Fork 0

prefix-handling analogues of errorf() and friends

called errorfc/infofc/warnfc/invalfc

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
alistair/sensors
Al Viro 2019-12-21 21:30:50 -05:00
parent 328de5287b
commit a3ff937b33
1 changed files with 4 additions and 0 deletions

View File

@ -203,6 +203,7 @@ void logfc(struct fc_log *log, const char *prefix, char level, const char *fmt,
*/
#define infof(fc, fmt, ...) __logfc(fc, 'i', fmt, ## __VA_ARGS__)
#define info_plog(p, fmt, ...) __plog(p, 'i', fmt, ## __VA_ARGS__)
#define infofc(p, fmt, ...) __plog((&(fc)->log), 'i', fmt, ## __VA_ARGS__)
/**
* warnf - Store supplementary warning message
@ -214,6 +215,7 @@ void logfc(struct fc_log *log, const char *prefix, char level, const char *fmt,
*/
#define warnf(fc, fmt, ...) __logfc(fc, 'w', fmt, ## __VA_ARGS__)
#define warn_plog(p, fmt, ...) __plog(p, 'w', fmt, ## __VA_ARGS__)
#define warnfc(fc, fmt, ...) __plog((&(fc)->log), 'w', fmt, ## __VA_ARGS__)
/**
* errorf - Store supplementary error message
@ -225,6 +227,7 @@ void logfc(struct fc_log *log, const char *prefix, char level, const char *fmt,
*/
#define errorf(fc, fmt, ...) __logfc(fc, 'e', fmt, ## __VA_ARGS__)
#define error_plog(p, fmt, ...) __plog(p, 'e', fmt, ## __VA_ARGS__)
#define errorfc(fc, fmt, ...) __plog((&(fc)->log), 'e', fmt, ## __VA_ARGS__)
/**
* invalf - Store supplementary invalid argument error message
@ -236,5 +239,6 @@ void logfc(struct fc_log *log, const char *prefix, char level, const char *fmt,
*/
#define invalf(fc, fmt, ...) (errorf(fc, fmt, ## __VA_ARGS__), -EINVAL)
#define inval_plog(p, fmt, ...) (error_plog(p, fmt, ## __VA_ARGS__), -EINVAL)
#define invalfc(fc, fmt, ...) (errorfc(fc, fmt, ## __VA_ARGS__), -EINVAL)
#endif /* _LINUX_FS_CONTEXT_H */