diff --git a/qdf/inc/qdf_atomic.h b/qdf/inc/qdf_atomic.h index 57f66d3ead..3b888c388f 100644 --- a/qdf/inc/qdf_atomic.h +++ b/qdf/inc/qdf_atomic.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2018 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 @@ -154,6 +154,17 @@ static inline int32_t qdf_atomic_dec_return(qdf_atomic_t *v) return __qdf_atomic_dec_return(v); } +/** + * qdf_atomic_inc_not_zero() - increment if not zero + * @v: A pointer to an opaque atomic variable + * + * Return: Returns non-zero on successful increment and zero otherwise + */ +static inline int32_t qdf_atomic_inc_not_zero(qdf_atomic_t *v) +{ + return __qdf_atomic_inc_not_zero(v); +} + /** * qdf_atomic_set_bit - Atomically set a bit in memory * @nr: bit to set diff --git a/qdf/linux/src/i_qdf_atomic.h b/qdf/linux/src/i_qdf_atomic.h index 1af747d6aa..1d2cb2b30a 100644 --- a/qdf/linux/src/i_qdf_atomic.h +++ b/qdf/linux/src/i_qdf_atomic.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2018 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 @@ -147,6 +147,17 @@ static inline int32_t __qdf_atomic_dec_return(__qdf_atomic_t *v) return atomic_dec_return(v); } +/** + * __qdf_atomic_inc_not_zero() - increment if not zero + * @v: A pointer to an opaque atomic variable + * + * Return: Returns non-zero on successful increment and zero otherwise + */ +static inline int32_t __qdf_atomic_inc_not_zero(__qdf_atomic_t *v) +{ + return atomic_inc_not_zero(v); +} + /** * __qdf_atomic_set_bit - Atomically set a bit in memory * @nr: bit to set