[PATCH libdrm 1/2] amdpgu: fix coding style in amdgpu_vamgr.c
Alex Deucher
alexdeucher at gmail.com
Tue Nov 7 18:03:55 UTC 2017
On Sat, Nov 4, 2017 at 10:43 AM, Christian König
<ckoenig.leichtzumerken at gmail.com> wrote:
> No functional change.
>
> Signed-off-by: Christian König <christian.koenig at amd.com>
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
> ---
> amdgpu/amdgpu_vamgr.c | 27 ++++++++++++++-------------
> 1 file changed, 14 insertions(+), 13 deletions(-)
>
> diff --git a/amdgpu/amdgpu_vamgr.c b/amdgpu/amdgpu_vamgr.c
> index 2b1388ed..8516b594 100644
> --- a/amdgpu/amdgpu_vamgr.c
> +++ b/amdgpu/amdgpu_vamgr.c
> @@ -34,18 +34,19 @@
> #include "util_math.h"
>
> int amdgpu_va_range_query(amdgpu_device_handle dev,
> - enum amdgpu_gpu_va_range type, uint64_t *start, uint64_t *end)
> + enum amdgpu_gpu_va_range type,
> + uint64_t *start, uint64_t *end)
> {
> - if (type == amdgpu_gpu_va_range_general) {
> - *start = dev->dev_info.virtual_address_offset;
> - *end = dev->dev_info.virtual_address_max;
> - return 0;
> - }
> - return -EINVAL;
> + if (type != amdgpu_gpu_va_range_general)
> + return -EINVAL;
> +
> + *start = dev->dev_info.virtual_address_offset;
> + *end = dev->dev_info.virtual_address_max;
> + return 0;
> }
>
> drm_private void amdgpu_vamgr_init(struct amdgpu_bo_va_mgr *mgr, uint64_t start,
> - uint64_t max, uint64_t alignment)
> + uint64_t max, uint64_t alignment)
> {
> mgr->va_offset = start;
> mgr->va_max = max;
> @@ -83,8 +84,8 @@ amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size,
> /* first look for a hole */
> LIST_FOR_EACH_ENTRY_SAFE(hole, n, &mgr->va_holes, list) {
> if (base_required) {
> - if(hole->offset > base_required ||
> - (hole->offset + hole->size) < (base_required + size))
> + if (hole->offset > base_required ||
> + (hole->offset + hole->size) < (base_required + size))
> continue;
> waste = base_required - hole->offset;
> offset = base_required;
> @@ -192,9 +193,9 @@ amdgpu_vamgr_free_va(struct amdgpu_bo_va_mgr *mgr, uint64_t va, uint64_t size)
> hole->offset = va;
> hole->size += size;
> /* Merge lower hole if it's adjacent */
> - if (next != hole
> - && &next->list != &mgr->va_holes
> - && (next->offset + next->size) == va) {
> + if (next != hole &&
> + &next->list != &mgr->va_holes &&
> + (next->offset + next->size) == va) {
> next->size += hole->size;
> list_del(&hole->list);
> free(hole);
> --
> 2.11.0
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
More information about the amd-gfx
mailing list