]> Pileus Git - ~andy/linux/commitdiff
ktime: Add __must_check prefix to ktime_to_timespec_cond
authorDaniel Borkmann <dborkman@redhat.com>
Thu, 16 May 2013 13:47:49 +0000 (15:47 +0200)
committerJohn Stultz <john.stultz@linaro.org>
Tue, 28 May 2013 21:00:58 +0000 (14:00 -0700)
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>
include/linux/ktime.h

index 608728a164a98bdd21d81c0cfbaeb649f1f25403..fc66b301b6480a03278ffd1b1a881d6c784a00a6 100644 (file)
@@ -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);