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
这个提交包含在:
@@ -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
|
||||
|
在新工单中引用
屏蔽一个用户