public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ktime: minor: ktime_to_timespec_cond: add __must_check prefix
@ 2013-05-16 13:47 Daniel Borkmann
  2013-05-28 19:16 ` John Stultz
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Borkmann @ 2013-05-16 13:47 UTC (permalink / raw)
  To: john.stultz; +Cc: linux-kernel

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>
---
 include/linux/ktime.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index bbca128..cededfd 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -338,7 +338,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);
-- 
1.7.11.7


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-05-28 19:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-16 13:47 [PATCH] ktime: minor: ktime_to_timespec_cond: add __must_check prefix Daniel Borkmann
2013-05-28 19:16 ` John Stultz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox