qcacmn: add QDF wrapper for qdf_atomic_inc_not_zero

Add API to increment atomic variable only when current
value is non zero

Change-Id: I3d0df35e39fb1b08b45e0731a86f002b5dbcb662
这个提交包含在:
Chaithanya Garrepalli
2020-01-13 16:00:34 +05:30
提交者 nshrivas
父节点 752b5a18a2
当前提交 06f280e5b5
修改 2 个文件,包含 24 行新增2 行删除

查看文件

@@ -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