diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-05-16 15:47:49 +0200 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2013-05-28 14:00:58 -0700 |
commit | 35b210855069ae34450eeaafc0f1b5bfa4f71c87 (patch) | |
tree | 7649bd4aaf13cb07152cbad8012bfec253916342 /include/linux/ktime.h | |
parent | a44b8bd6072ac82fc49af941de8c1ac85d94852d (diff) | |
download | linux-stable-35b210855069ae34450eeaafc0f1b5bfa4f71c87.tar.gz linux-stable-35b210855069ae34450eeaafc0f1b5bfa4f71c87.tar.bz2 linux-stable-35b210855069ae34450eeaafc0f1b5bfa4f71c87.zip |
ktime: Add __must_check prefix to ktime_to_timespec_cond
The function is currently mainly used in the networking code and
if others start using it, they must check the result, otherwise
it cannot be determined if the timespec conversion suceeded.
Currently no user lacks this check, but make future users aware of
a possible misusage.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'include/linux/ktime.h')
-rw-r--r-- | include/linux/ktime.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/ktime.h b/include/linux/ktime.h index 608728a164a9..fc66b301b648 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h @@ -339,7 +339,8 @@ extern ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs); * * Returns true if there was a successful conversion, false if kt was 0. */ -static inline bool ktime_to_timespec_cond(const ktime_t kt, struct timespec *ts) +static inline __must_check bool ktime_to_timespec_cond(const ktime_t kt, + struct timespec *ts) { if (kt.tv64) { *ts = ktime_to_timespec(kt); |