summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Bornyakov <brnkv.i1@gmail.com>2018-05-22 16:34:39 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-05-25 18:41:19 +0200
commit1e71247364a0805328eabc29fc627c808c88d3fe (patch)
tree8ccc3750e4abd80f610d0eb777c6d1e87ea9186b
parent777690e68cbe27e266a746a9f5b63e273fe1a7a0 (diff)
downloadlinux-1e71247364a0805328eabc29fc627c808c88d3fe.tar.bz2
staging: lustre: libcfs: add parens around macros args
One may call 'CFS_FAIL_TIMEOUT(id, secs + 5);' and get unexpected result after macro substitution, viz., 'secs + 5' will turn into 'secs + 5 * 1000' Signed-off-by: Ivan Bornyakov <brnkv.i1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h
index a0c3413f4e6e..8074e390b4d1 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h
@@ -143,7 +143,7 @@ static inline int cfs_fail_timeout_set(u32 id, u32 value, int ms, int set)
/* If id hit cfs_fail_loc, sleep for seconds or milliseconds */
#define CFS_FAIL_TIMEOUT(id, secs) \
- cfs_fail_timeout_set(id, 0, secs * 1000, CFS_FAIL_LOC_NOSET)
+ cfs_fail_timeout_set(id, 0, (secs) * 1000, CFS_FAIL_LOC_NOSET)
#define CFS_FAIL_TIMEOUT_MS(id, ms) \
cfs_fail_timeout_set(id, 0, ms, CFS_FAIL_LOC_NOSET)
@@ -153,10 +153,10 @@ static inline int cfs_fail_timeout_set(u32 id, u32 value, int ms, int set)
* sleep seconds or milliseconds
*/
#define CFS_FAIL_TIMEOUT_ORSET(id, value, secs) \
- cfs_fail_timeout_set(id, value, secs * 1000, CFS_FAIL_LOC_ORSET)
+ cfs_fail_timeout_set(id, value, (secs) * 1000, CFS_FAIL_LOC_ORSET)
#define CFS_FAIL_TIMEOUT_RESET(id, value, secs) \
- cfs_fail_timeout_set(id, value, secs * 1000, CFS_FAIL_LOC_RESET)
+ cfs_fail_timeout_set(id, value, (secs) * 1000, CFS_FAIL_LOC_RESET)
#define CFS_FAIL_TIMEOUT_MS_ORSET(id, value, ms) \
cfs_fail_timeout_set(id, value, ms, CFS_FAIL_LOC_ORSET)