ble_mesh: Remove useless parameters of lock/unlock

This commit is contained in:
lly
2019-12-14 16:28:22 +08:00
parent d2bc597e9f
commit e4223df60f
4 changed files with 23 additions and 35 deletions

View File

@@ -55,15 +55,14 @@ bt_mesh_atomic_val_t bt_mesh_atomic_get(const bt_mesh_atomic_t *target)
*/
bt_mesh_atomic_val_t bt_mesh_atomic_set(bt_mesh_atomic_t *target, bt_mesh_atomic_val_t value)
{
unsigned int key;
bt_mesh_atomic_val_t ret;
key = bt_mesh_irq_lock();
bt_mesh_irq_lock();
ret = *target;
*target = value;
bt_mesh_irq_unlock(key);
bt_mesh_irq_unlock();
return ret;
}
@@ -83,15 +82,14 @@ bt_mesh_atomic_val_t bt_mesh_atomic_set(bt_mesh_atomic_t *target, bt_mesh_atomic
*/
bt_mesh_atomic_val_t bt_mesh_atomic_or(bt_mesh_atomic_t *target, bt_mesh_atomic_val_t value)
{
unsigned int key;
bt_mesh_atomic_val_t ret;
key = bt_mesh_irq_lock();
bt_mesh_irq_lock();
ret = *target;
*target |= value;
bt_mesh_irq_unlock(key);
bt_mesh_irq_unlock();
return ret;
}
@@ -111,15 +109,14 @@ bt_mesh_atomic_val_t bt_mesh_atomic_or(bt_mesh_atomic_t *target, bt_mesh_atomic_
*/
bt_mesh_atomic_val_t bt_mesh_atomic_and(bt_mesh_atomic_t *target, bt_mesh_atomic_val_t value)
{
unsigned int key;
bt_mesh_atomic_val_t ret;
key = bt_mesh_irq_lock();
bt_mesh_irq_lock();
ret = *target;
*target &= value;
bt_mesh_irq_unlock(key);
bt_mesh_irq_unlock();
return ret;
}
@@ -137,15 +134,14 @@ bt_mesh_atomic_val_t bt_mesh_atomic_and(bt_mesh_atomic_t *target, bt_mesh_atomic
*/
bt_mesh_atomic_val_t bt_mesh_atomic_dec(bt_mesh_atomic_t *target)
{
unsigned int key;
bt_mesh_atomic_val_t ret;
key = bt_mesh_irq_lock();
bt_mesh_irq_lock();
ret = *target;
(*target)--;
bt_mesh_irq_unlock(key);
bt_mesh_irq_unlock();
return ret;
}
@@ -163,15 +159,14 @@ bt_mesh_atomic_val_t bt_mesh_atomic_dec(bt_mesh_atomic_t *target)
*/
bt_mesh_atomic_val_t bt_mesh_atomic_inc(bt_mesh_atomic_t *target)
{
unsigned int key;
bt_mesh_atomic_val_t ret;
key = bt_mesh_irq_lock();
bt_mesh_irq_lock();
ret = *target;
(*target)++;
bt_mesh_irq_unlock(key);
bt_mesh_irq_unlock();
return ret;
}