Apply a few stylistic cleanups to match kernel code.

main
Arjan van de Ven 2008-05-07 15:54:32 -07:00 committed by Eric Anholt
parent 06e9761f94
commit aa0621a19f
1 changed files with 7 additions and 7 deletions

View File

@ -217,8 +217,7 @@ drm_gem_alloc_ioctl(struct drm_device *dev, void *data,
if (!(dev->driver->driver_features & DRIVER_GEM)) if (!(dev->driver->driver_features & DRIVER_GEM))
return -ENODEV; return -ENODEV;
/* Round requested size up to page size */ args->size = roundup(args->size, PAGE_SIZE);
args->size = (args->size + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1);
/* Allocate the new object */ /* Allocate the new object */
obj = drm_gem_object_alloc(dev, args->size); 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; offset = args->offset;
read = obj->filp->f_op->read(obj->filp, (char __user *)(uintptr_t)args->data_ptr, read = vfs_read(obj->filp, (char __user *)(uintptr_t)args->data_ptr,
args->size, &offset); args->size, &offset);
if (read != args->size) { if (read != args->size) {
drm_gem_object_unreference(obj); drm_gem_object_unreference(obj);
if (read < 0) if (read < 0)
@ -324,7 +323,7 @@ drm_gem_mmap_ioctl(struct drm_device *dev, void *data,
up_write(&current->mm->mmap_sem); up_write(&current->mm->mmap_sem);
drm_gem_object_unreference(obj); drm_gem_object_unreference(obj);
if (IS_ERR((void *)addr)) if (IS_ERR((void *)addr))
return (int) addr; return addr;
/* XXX hack until we have a driver callback to make this work */ /* XXX hack until we have a driver callback to make this work */
obj->read_domains = DRM_GEM_DOMAIN_CPU; obj->read_domains = DRM_GEM_DOMAIN_CPU;
@ -358,8 +357,9 @@ drm_gem_pwrite_ioctl(struct drm_device *dev, void *data,
offset = args->offset; offset = args->offset;
written = obj->filp->f_op->write(obj->filp, (char __user *)(uintptr_t) args->data_ptr, written = vfs_write(obj->filp,
args->size, &offset); (char __user *)(uintptr_t) args->data_ptr,
args->size, &offset);
if (written != args->size) { if (written != args->size) {
drm_gem_object_unreference(obj); drm_gem_object_unreference(obj);
if (written < 0) if (written < 0)