aboutsummaryrefslogtreecommitdiff
path: root/linux-core/drm_gem.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2008-05-07 15:54:32 -0700
committerEric Anholt <eric@anholt.net>2008-05-07 15:54:53 -0700
commitaa0621a19ffcdf2a92eac08fa4950e0423a8dd2b (patch)
tree2847af9d60a813bd2443b361073da4e75019faca /linux-core/drm_gem.c
parent06e9761f94599c6378c8fa0cdbd1e1c1776bae7a (diff)
Apply a few stylistic cleanups to match kernel code.
Diffstat (limited to 'linux-core/drm_gem.c')
-rw-r--r--linux-core/drm_gem.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/linux-core/drm_gem.c b/linux-core/drm_gem.c
index e2272f27..4eaeffcf 100644
--- a/linux-core/drm_gem.c
+++ b/linux-core/drm_gem.c
@@ -217,8 +217,7 @@ drm_gem_alloc_ioctl(struct drm_device *dev, void *data,
if (!(dev->driver->driver_features & DRIVER_GEM))
return -ENODEV;
- /* Round requested size up to page size */
- args->size = (args->size + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1);
+ args->size = roundup(args->size, PAGE_SIZE);
/* Allocate the new object */
obj = drm_gem_object_alloc(dev, args->size);
@@ -277,8 +276,8 @@ drm_gem_pread_ioctl(struct drm_device *dev, void *data,
offset = args->offset;
- read = obj->filp->f_op->read(obj->filp, (char __user *)(uintptr_t)args->data_ptr,
- args->size, &offset);
+ read = vfs_read(obj->filp, (char __user *)(uintptr_t)args->data_ptr,
+ args->size, &offset);
if (read != args->size) {
drm_gem_object_unreference(obj);
if (read < 0)
@@ -324,7 +323,7 @@ drm_gem_mmap_ioctl(struct drm_device *dev, void *data,
up_write(&current->mm->mmap_sem);
drm_gem_object_unreference(obj);
if (IS_ERR((void *)addr))
- return (int) addr;
+ return addr;
/* XXX hack until we have a driver callback to make this work */
obj->read_domains = DRM_GEM_DOMAIN_CPU;
@@ -358,8 +357,9 @@ drm_gem_pwrite_ioctl(struct drm_device *dev, void *data,
offset = args->offset;
- written = obj->filp->f_op->write(obj->filp, (char __user *)(uintptr_t) args->data_ptr,
- args->size, &offset);
+ written = vfs_write(obj->filp,
+ (char __user *)(uintptr_t) args->data_ptr,
+ args->size, &offset);
if (written != args->size) {
drm_gem_object_unreference(obj);
if (written < 0)