summaryrefslogtreecommitdiff
path: root/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.com>2018-03-29 15:26:48 +1100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-23 14:52:51 +0200
commitb0fdb5702533eda27357102ff221297fe5cf009b (patch)
tree582b70ae5a9b1d94499389637c9a13f65a151d92 /drivers/staging/lustre/include/linux/libcfs/libcfs_time.h
parent4671dc9f97bca650708ea3b304bb952c3b767b6a (diff)
staging: lustre: libcfs: discard cfs_time_add/sub
cfs_time_add adds its arguments. cfs_time_sub subtracts finds the difference. Discard these and use '+' and '-' directly. This change highlighted a type error. The structure field cr_queued_time was used to store jiffies, but was declared as time_t (meant for seconds). So the time is changed to "unsigned long". Signed-off-by: NeilBrown <neilb@suse.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/include/linux/libcfs/libcfs_time.h')
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/libcfs_time.h12
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h
index df7a3f13f3b3..7b41a129f041 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h
@@ -40,16 +40,6 @@
* generic time manipulation functions.
*/
-static inline unsigned long cfs_time_add(unsigned long t, long d)
-{
- return (unsigned long)(t + d);
-}
-
-static inline unsigned long cfs_time_sub(unsigned long t1, unsigned long t2)
-{
- return (unsigned long)(t1 - t2);
-}
-
static inline int cfs_time_after(unsigned long t1, unsigned long t2)
{
return time_before(t2, t1);
@@ -62,7 +52,7 @@ static inline int cfs_time_aftereq(unsigned long t1, unsigned long t2)
static inline unsigned long cfs_time_shift(int seconds)
{
- return cfs_time_add(jiffies, seconds * HZ);
+ return jiffies + seconds * HZ;
}
/*