atomic: Add const declaration to atomic_get
The atomic_get() function is a read-only API which doesn't modify the value given to it. The input parameter should therefore be declared as const. Change-Id: I084b7beb623610412f9237fc9dae6139580e2636 Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
839fb27f41
commit
24c44026db
2 changed files with 2 additions and 2 deletions
|
@ -199,7 +199,7 @@ atomic_val_t atomic_dec(
|
||||||
* RETURNS: The value read from <target>
|
* RETURNS: The value read from <target>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
atomic_val_t atomic_get(atomic_t *target /* memory location to read from */
|
atomic_val_t atomic_get(const atomic_t *target /* memory location to read from */
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return *target;
|
return *target;
|
||||||
|
|
|
@ -49,7 +49,7 @@ extern atomic_val_t atomic_or(atomic_t *target, atomic_val_t value);
|
||||||
extern atomic_val_t atomic_sub(atomic_t *target, atomic_val_t value);
|
extern atomic_val_t atomic_sub(atomic_t *target, atomic_val_t value);
|
||||||
extern atomic_val_t atomic_xor(atomic_t *target, atomic_val_t value);
|
extern atomic_val_t atomic_xor(atomic_t *target, atomic_val_t value);
|
||||||
extern atomic_val_t atomic_clear(atomic_t *target);
|
extern atomic_val_t atomic_clear(atomic_t *target);
|
||||||
extern atomic_val_t atomic_get(atomic_t *target);
|
extern atomic_val_t atomic_get(const atomic_t *target);
|
||||||
extern atomic_val_t atomic_set(atomic_t *target, atomic_val_t value);
|
extern atomic_val_t atomic_set(atomic_t *target, atomic_val_t value);
|
||||||
extern int atomic_cas(atomic_t *target,
|
extern int atomic_cas(atomic_t *target,
|
||||||
atomic_val_t oldValue, atomic_val_t newValue);
|
atomic_val_t oldValue, atomic_val_t newValue);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue