Skip to content

Commit

Permalink
ktime: Add __must_check prefix to ktime_to_timespec_cond
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Daniel Borkmann authored and John Stultz committed May 28, 2013
1 parent a44b8bd commit 35b2108
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/linux/ktime.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 35b2108

Please sign in to comment.