All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH libdrm 1/2] amdpgu: fix coding style in amdgpu_vamgr.c
@ 2017-11-04 14:43 Christian König
       [not found] ` <20171104144331.1464-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Christian König @ 2017-11-04 14:43 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

No functional change.

Signed-off-by: Christian König <christian.koenig@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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-07 18:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-04 14:43 [PATCH libdrm 1/2] amdpgu: fix coding style in amdgpu_vamgr.c Christian König
     [not found] ` <20171104144331.1464-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2017-11-04 14:43   ` [PATCH libdrm 2/2] amdgpu: sanitize 64bit VA manager Christian König
     [not found]     ` <20171104144331.1464-2-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2017-11-07 18:38       ` Alex Deucher
2017-11-07 18:03   ` [PATCH libdrm 1/2] amdpgu: fix coding style in amdgpu_vamgr.c Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.