From: NeilBrown Date: Mon, 21 May 2018 04:35:12 +0000 (+1000) Subject: staging: lustre: move LERRCHKSUM() to libcfs_debug.h X-Git-Tag: for-linus-20180616~25^2~107 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=44a3c2637cd2ce59a2312dc886303e32c39d6f01;p=linux-block.git staging: lustre: move LERRCHKSUM() to libcfs_debug.h This macro is only used for debug messages, so use it to the debug code. Also improve the documentation slightly. Signed-off-by: NeilBrown Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/libcfs.h index 57d66aff546b..be40cf4fb44a 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h @@ -89,13 +89,6 @@ #define LIBCFS_VERSION "0.7.0" -/* - * Lustre Error Checksum: calculates checksum - * of Hex number by XORing each bit. - */ -#define LERRCHKSUM(hexnum) (((hexnum) & 0xf) ^ ((hexnum) >> 4 & 0xf) ^ \ - ((hexnum) >> 8 & 0xf)) - /* need both kernel and user-land acceptor */ #define LNET_ACCEPTOR_MIN_RESERVED_PORT 512 #define LNET_ACCEPTOR_MAX_RESERVED_PORT 1023 diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h index 0dc7b91efe7c..07f7d306ba9a 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h @@ -165,6 +165,13 @@ do { \ __CDEBUG(&cdls, mask, format, ## __VA_ARGS__); \ } while (0) +/* + * Lustre Error Checksum: calculates checksum + * of Hex number by XORing the nybbles. + */ +#define LERRCHKSUM(hexnum) (((hexnum) & 0xf) ^ ((hexnum) >> 4 & 0xf) ^ \ + ((hexnum) >> 8 & 0xf)) + #define CWARN(format, ...) CDEBUG_LIMIT(D_WARNING, format, ## __VA_ARGS__) #define CERROR(format, ...) CDEBUG_LIMIT(D_ERROR, format, ## __VA_ARGS__) #define CNETERR(format, a...) CDEBUG_LIMIT(D_NETERROR, format, ## a)