diff options
author | NeilBrown <neilb@suse.com> | 2018-03-29 15:26:48 +1100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-04-23 14:52:51 +0200 |
commit | b0fdb5702533eda27357102ff221297fe5cf009b (patch) | |
tree | 582b70ae5a9b1d94499389637c9a13f65a151d92 /drivers/staging/lustre/include | |
parent | 4671dc9f97bca650708ea3b304bb952c3b767b6a (diff) | |
download | op-kernel-dev-b0fdb5702533eda27357102ff221297fe5cf009b.zip op-kernel-dev-b0fdb5702533eda27357102ff221297fe5cf009b.tar.gz |
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')
-rw-r--r-- | drivers/staging/lustre/include/linux/libcfs/libcfs_time.h | 12 | ||||
-rw-r--r-- | drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h | 8 |
2 files changed, 2 insertions, 18 deletions
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h index df7a3f1..7b41a12 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; } /* diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h index ba115e8..b3a8053 100644 --- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h +++ b/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h @@ -65,15 +65,9 @@ static inline long cfs_duration_sec(long d) return d / msecs_to_jiffies(MSEC_PER_SEC); } -static inline u64 cfs_time_add_64(u64 t, u64 d) -{ - return t + d; -} - static inline u64 cfs_time_shift_64(int seconds) { - return cfs_time_add_64(get_jiffies_64(), - seconds * HZ); + return get_jiffies_64() + (u64)seconds * HZ; } static inline int cfs_time_before_64(u64 t1, u64 t2) |