mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-07 15:18:15 +00:00
drm/ttm: use swap macro in ttm_bo_handle_move_mem
Make use of the swap macro and remove unnecessary variable *tmp_mem*. This makes the code easier to read and maintain. Also, reduces the stack usage. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
c3cb424a08
commit
31e1c59796
1 changed files with 2 additions and 5 deletions
|
@ -287,12 +287,9 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
if (bdev->driver->move_notify) {
|
if (bdev->driver->move_notify) {
|
||||||
struct ttm_mem_reg tmp_mem = *mem;
|
swap(*mem, bo->mem);
|
||||||
*mem = bo->mem;
|
|
||||||
bo->mem = tmp_mem;
|
|
||||||
bdev->driver->move_notify(bo, false, mem);
|
bdev->driver->move_notify(bo, false, mem);
|
||||||
bo->mem = *mem;
|
swap(*mem, bo->mem);
|
||||||
*mem = tmp_mem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
goto out_err;
|
goto out_err;
|
||||||
|
|
Loading…
Add table
Reference in a new issue