Merge drm/drm-next into drm-misc-next
[linux-block.git] / drivers / accel / qaic / qaic_data.c
index f88d925c8001c4541bff1922a79b31c5c3d03b42..2459fe4a3f95a7c596de929bf6297cac89f01a38 100644 (file)
@@ -457,7 +457,7 @@ static int create_sgt(struct qaic_device *qdev, struct sg_table **sgt_out, u64 s
                 * later
                 */
                buf_extra = (PAGE_SIZE - size % PAGE_SIZE) % PAGE_SIZE;
-               max_order = min(MAX_ORDER, get_order(size));
+               max_order = min(MAX_PAGE_ORDER, get_order(size));
        } else {
                /* allocate a single page for book keeping */
                nr_pages = 1;
@@ -787,7 +787,6 @@ struct drm_gem_object *qaic_gem_prime_import(struct drm_device *dev, struct dma_
        struct dma_buf_attachment *attach;
        struct drm_gem_object *obj;
        struct qaic_bo *bo;
-       size_t size;
        int ret;
 
        bo = qaic_alloc_init_bo();
@@ -805,13 +804,12 @@ struct drm_gem_object *qaic_gem_prime_import(struct drm_device *dev, struct dma_
                goto attach_fail;
        }
 
-       size = PAGE_ALIGN(attach->dmabuf->size);
-       if (size == 0) {
+       if (!attach->dmabuf->size) {
                ret = -EINVAL;
                goto size_align_fail;
        }
 
-       drm_gem_private_object_init(dev, obj, size);
+       drm_gem_private_object_init(dev, obj, attach->dmabuf->size);
        /*
         * skipping dma_buf_map_attachment() as we do not know the direction
         * just yet. Once the direction is known in the subsequent IOCTL to