提交 35b21085 编写于 作者: D Daniel Borkmann 提交者: John Stultz

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: NDaniel Borkmann <dborkman@redhat.com>
Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
上级 a44b8bd6
...@@ -339,7 +339,8 @@ extern ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs); ...@@ -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. * 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) { if (kt.tv64) {
*ts = ktime_to_timespec(kt); *ts = ktime_to_timespec(kt);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册