Commit 30953c4d authored by Srinivasan Shanmugam's avatar Srinivasan Shanmugam Committed by Alex Deucher

drm/amdgpu: Fix style issues in amdgpu_gem.c

Fixes the following to align to linux coding style:

WARNING: braces {} are not necessary for any arm of this statement
WARNING: Missing a blank line after declarations
ERROR: space prohibited before that close parenthesis ')'
WARNING: unnecessary whitespace before a quoted newline
WARNING: %LX is non-standard C, use %llX

Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 0d882e43
...@@ -181,11 +181,10 @@ static int amdgpu_gem_object_open(struct drm_gem_object *obj, ...@@ -181,11 +181,10 @@ static int amdgpu_gem_object_open(struct drm_gem_object *obj,
return r; return r;
bo_va = amdgpu_vm_bo_find(vm, abo); bo_va = amdgpu_vm_bo_find(vm, abo);
if (!bo_va) { if (!bo_va)
bo_va = amdgpu_vm_bo_add(adev, vm, abo); bo_va = amdgpu_vm_bo_add(adev, vm, abo);
} else { else
++bo_va->ref_count; ++bo_va->ref_count;
}
amdgpu_bo_unreserve(abo); amdgpu_bo_unreserve(abo);
return 0; return 0;
} }
...@@ -217,8 +216,8 @@ static void amdgpu_gem_object_close(struct drm_gem_object *obj, ...@@ -217,8 +216,8 @@ static void amdgpu_gem_object_close(struct drm_gem_object *obj,
r = ttm_eu_reserve_buffers(&ticket, &list, false, &duplicates); r = ttm_eu_reserve_buffers(&ticket, &list, false, &duplicates);
if (r) { if (r) {
dev_err(adev->dev, "leaking bo va because " dev_err(adev->dev, "leaking bo va because we fail to reserve bo (%ld)\n",
"we fail to reserve bo (%ld)\n", r); r);
return; return;
} }
bo_va = amdgpu_vm_bo_find(vm, bo); bo_va = amdgpu_vm_bo_find(vm, bo);
...@@ -238,8 +237,8 @@ static void amdgpu_gem_object_close(struct drm_gem_object *obj, ...@@ -238,8 +237,8 @@ static void amdgpu_gem_object_close(struct drm_gem_object *obj,
out_unlock: out_unlock:
if (unlikely(r < 0)) if (unlikely(r < 0))
dev_err(adev->dev, "failed to clear page " dev_err(adev->dev, "failed to clear page tables on GEM object close (%ld)\n",
"tables on GEM object close (%ld)\n", r); r);
ttm_eu_backoff_reservation(&ticket, &list); ttm_eu_backoff_reservation(&ticket, &list);
} }
...@@ -463,9 +462,9 @@ int amdgpu_mode_dumb_mmap(struct drm_file *filp, ...@@ -463,9 +462,9 @@ int amdgpu_mode_dumb_mmap(struct drm_file *filp,
struct amdgpu_bo *robj; struct amdgpu_bo *robj;
gobj = drm_gem_object_lookup(filp, handle); gobj = drm_gem_object_lookup(filp, handle);
if (gobj == NULL) { if (!gobj)
return -ENOENT; return -ENOENT;
}
robj = gem_to_amdgpu_bo(gobj); robj = gem_to_amdgpu_bo(gobj);
if (amdgpu_ttm_tt_get_usermm(robj->tbo.ttm) || if (amdgpu_ttm_tt_get_usermm(robj->tbo.ttm) ||
(robj->flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS)) { (robj->flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS)) {
...@@ -482,6 +481,7 @@ int amdgpu_gem_mmap_ioctl(struct drm_device *dev, void *data, ...@@ -482,6 +481,7 @@ int amdgpu_gem_mmap_ioctl(struct drm_device *dev, void *data,
{ {
union drm_amdgpu_gem_mmap *args = data; union drm_amdgpu_gem_mmap *args = data;
uint32_t handle = args->in.handle; uint32_t handle = args->in.handle;
memset(args, 0, sizeof(*args)); memset(args, 0, sizeof(*args));
return amdgpu_mode_dumb_mmap(filp, dev, handle, &args->out.addr_ptr); return amdgpu_mode_dumb_mmap(filp, dev, handle, &args->out.addr_ptr);
} }
...@@ -508,7 +508,7 @@ unsigned long amdgpu_gem_timeout(uint64_t timeout_ns) ...@@ -508,7 +508,7 @@ unsigned long amdgpu_gem_timeout(uint64_t timeout_ns)
timeout_jiffies = nsecs_to_jiffies(ktime_to_ns(timeout)); timeout_jiffies = nsecs_to_jiffies(ktime_to_ns(timeout));
/* clamp timeout to avoid unsigned-> signed overflow */ /* clamp timeout to avoid unsigned-> signed overflow */
if (timeout_jiffies > MAX_SCHEDULE_TIMEOUT ) if (timeout_jiffies > MAX_SCHEDULE_TIMEOUT)
return MAX_SCHEDULE_TIMEOUT - 1; return MAX_SCHEDULE_TIMEOUT - 1;
return timeout_jiffies; return timeout_jiffies;
...@@ -526,9 +526,9 @@ int amdgpu_gem_wait_idle_ioctl(struct drm_device *dev, void *data, ...@@ -526,9 +526,9 @@ int amdgpu_gem_wait_idle_ioctl(struct drm_device *dev, void *data,
long ret; long ret;
gobj = drm_gem_object_lookup(filp, handle); gobj = drm_gem_object_lookup(filp, handle);
if (gobj == NULL) { if (!gobj)
return -ENOENT; return -ENOENT;
}
robj = gem_to_amdgpu_bo(gobj); robj = gem_to_amdgpu_bo(gobj);
ret = dma_resv_wait_timeout(robj->tbo.base.resv, DMA_RESV_USAGE_READ, ret = dma_resv_wait_timeout(robj->tbo.base.resv, DMA_RESV_USAGE_READ,
true, timeout); true, timeout);
...@@ -555,7 +555,7 @@ int amdgpu_gem_metadata_ioctl(struct drm_device *dev, void *data, ...@@ -555,7 +555,7 @@ int amdgpu_gem_metadata_ioctl(struct drm_device *dev, void *data,
struct amdgpu_bo *robj; struct amdgpu_bo *robj;
int r = -1; int r = -1;
DRM_DEBUG("%d \n", args->handle); DRM_DEBUG("%d\n", args->handle);
gobj = drm_gem_object_lookup(filp, args->handle); gobj = drm_gem_object_lookup(filp, args->handle);
if (gobj == NULL) if (gobj == NULL)
return -ENOENT; return -ENOENT;
...@@ -685,7 +685,7 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev, void *data, ...@@ -685,7 +685,7 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev, void *data,
if (args->va_address < AMDGPU_VA_RESERVED_SIZE) { if (args->va_address < AMDGPU_VA_RESERVED_SIZE) {
dev_dbg(dev->dev, dev_dbg(dev->dev,
"va_address 0x%LX is in reserved area 0x%LX\n", "va_address 0x%llx is in reserved area 0x%llx\n",
args->va_address, AMDGPU_VA_RESERVED_SIZE); args->va_address, AMDGPU_VA_RESERVED_SIZE);
return -EINVAL; return -EINVAL;
} }
...@@ -693,7 +693,7 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev, void *data, ...@@ -693,7 +693,7 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev, void *data,
if (args->va_address >= AMDGPU_GMC_HOLE_START && if (args->va_address >= AMDGPU_GMC_HOLE_START &&
args->va_address < AMDGPU_GMC_HOLE_END) { args->va_address < AMDGPU_GMC_HOLE_END) {
dev_dbg(dev->dev, dev_dbg(dev->dev,
"va_address 0x%LX is in VA hole 0x%LX-0x%LX\n", "va_address 0x%llx is in VA hole 0x%llx-0x%llx\n",
args->va_address, AMDGPU_GMC_HOLE_START, args->va_address, AMDGPU_GMC_HOLE_START,
AMDGPU_GMC_HOLE_END); AMDGPU_GMC_HOLE_END);
return -EINVAL; return -EINVAL;
...@@ -813,9 +813,9 @@ int amdgpu_gem_op_ioctl(struct drm_device *dev, void *data, ...@@ -813,9 +813,9 @@ int amdgpu_gem_op_ioctl(struct drm_device *dev, void *data,
int r; int r;
gobj = drm_gem_object_lookup(filp, args->handle); gobj = drm_gem_object_lookup(filp, args->handle);
if (gobj == NULL) { if (!gobj)
return -ENOENT; return -ENOENT;
}
robj = gem_to_amdgpu_bo(gobj); robj = gem_to_amdgpu_bo(gobj);
r = amdgpu_bo_reserve(robj, false); r = amdgpu_bo_reserve(robj, false);
...@@ -941,9 +941,9 @@ int amdgpu_mode_dumb_create(struct drm_file *file_priv, ...@@ -941,9 +941,9 @@ int amdgpu_mode_dumb_create(struct drm_file *file_priv,
r = drm_gem_handle_create(file_priv, gobj, &handle); r = drm_gem_handle_create(file_priv, gobj, &handle);
/* drop reference from allocate - handle holds it now */ /* drop reference from allocate - handle holds it now */
drm_gem_object_put(gobj); drm_gem_object_put(gobj);
if (r) { if (r)
return r; return r;
}
args->handle = handle; args->handle = handle;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment