From: Daniel Borkmann Date: Thu, 16 May 2013 13:47:49 +0000 (+0200) Subject: ktime: Add __must_check prefix to ktime_to_timespec_cond X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=35b210855069ae34450eeaafc0f1b5bfa4f71c87;p=linux-beck.git 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 Signed-off-by: John Stultz --- 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);