From 081f6f0549b2a4a8f6890444ee041f071388ca36 Mon Sep 17 00:00:00 2001 From: Vivek Date: Fri, 20 Nov 2020 00:08:10 +0530 Subject: [PATCH] qcacmn: Update timer modification API to return the status The current timer modification API does not return the status of the underlying OS specific API. The return status of the underlying API could be useful to detect if the timer was modified even before the timer has expired before the last update to the timer. Update the API to return the status of the underlying API. CRs-Fixed: 2835319 Change-Id: Ieade0ff82386f959d7f29264a25b75a96a72e644 --- qdf/inc/qdf_timer.h | 8 ++++---- qdf/linux/src/i_qdf_timer.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/qdf/inc/qdf_timer.h b/qdf/inc/qdf_timer.h index 83ec8d3bd1..07841a44a6 100644 --- a/qdf/inc/qdf_timer.h +++ b/qdf/inc/qdf_timer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2016, 2018-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2016, 2018-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -74,11 +74,11 @@ static inline void qdf_timer_start(qdf_timer_t *timer, int msec) * * If QDF timer multiplier is set, the timeout value may get scaled. * - * Return: none + * Return: true if @timer is already active, false if @timer was not active */ -static inline void qdf_timer_mod(qdf_timer_t *timer, int msec) +static inline bool qdf_timer_mod(qdf_timer_t *timer, int msec) { - __qdf_timer_mod(timer, msec); + return __qdf_timer_mod(timer, msec); } /** diff --git a/qdf/linux/src/i_qdf_timer.h b/qdf/linux/src/i_qdf_timer.h index 29c7782a94..4bd1332c4f 100644 --- a/qdf/linux/src/i_qdf_timer.h +++ b/qdf/linux/src/i_qdf_timer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -131,10 +131,10 @@ static inline void __qdf_timer_start(struct __qdf_timer_t *timer, uint32_t msec) add_timer(os_timer); } -static inline void __qdf_timer_mod(struct __qdf_timer_t *timer, uint32_t msec) +static inline bool __qdf_timer_mod(struct __qdf_timer_t *timer, uint32_t msec) { - mod_timer(&timer->os_timer, - jiffies + __qdf_scaled_msecs_to_jiffies(msec)); + return mod_timer(&timer->os_timer, + jiffies + __qdf_scaled_msecs_to_jiffies(msec)); } static inline bool __qdf_timer_stop(struct __qdf_timer_t *timer)