[PATCH 6/9] drm/amdkfd: Compress unnecessary function parameters
Oded Gabbay
oded.gabbay at gmail.com
Sun Oct 8 12:34:39 UTC 2017
On Wed, Sep 27, 2017 at 7:09 AM, Felix Kuehling <Felix.Kuehling at amd.com> wrote:
> From: Yong Zhao <yong.zhao at amd.com>
>
> Signed-off-by: Yong Zhao <yong.zhao at amd.com>
> ---
> drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 3 +--
> drivers/gpu/drm/amd/amdkfd/kfd_dbgdev.c | 5 +++--
> drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 2 --
> drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 10 +++-------
> 4 files changed, 7 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> index e4a8c2e..c4632aeb 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> @@ -282,8 +282,7 @@ static int kfd_ioctl_create_queue(struct file *filep, struct kfd_process *p,
> p->pasid,
> dev->id);
>
> - err = pqm_create_queue(&p->pqm, dev, filep, &q_properties,
> - 0, q_properties.type, &queue_id);
> + err = pqm_create_queue(&p->pqm, dev, filep, &q_properties, &queue_id);
> if (err != 0)
> goto err_create_queue;
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_dbgdev.c b/drivers/gpu/drm/amd/amdkfd/kfd_dbgdev.c
> index 7d5635f..c407f6b 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_dbgdev.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_dbgdev.c
> @@ -184,9 +184,10 @@ static int dbgdev_register_diq(struct kfd_dbgdev *dbgdev)
> struct kernel_queue *kq = NULL;
> int status;
>
> + properties.type = KFD_QUEUE_TYPE_DIQ;
> +
> status = pqm_create_queue(dbgdev->pqm, dbgdev->dev, NULL,
> - &properties, 0, KFD_QUEUE_TYPE_DIQ,
> - &qid);
> + &properties, &qid);
>
> if (status) {
> pr_err("Failed to create DIQ\n");
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
> index b936a12..ca37210 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
> @@ -675,8 +675,6 @@ int pqm_create_queue(struct process_queue_manager *pqm,
> struct kfd_dev *dev,
> struct file *f,
> struct queue_properties *properties,
> - unsigned int flags,
> - enum kfd_queue_type type,
> unsigned int *qid);
> int pqm_destroy_queue(struct process_queue_manager *pqm, unsigned int qid);
> int pqm_update_queue(struct process_queue_manager *pqm, unsigned int qid,
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
> index 31ec3ca..63c569b 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
> @@ -142,20 +142,17 @@ int pqm_create_queue(struct process_queue_manager *pqm,
> struct kfd_dev *dev,
> struct file *f,
> struct queue_properties *properties,
> - unsigned int flags,
> - enum kfd_queue_type type,
> unsigned int *qid)
> {
> int retval;
> struct kfd_process_device *pdd;
> - struct queue_properties q_properties;
> struct queue *q;
> struct process_queue_node *pqn;
> struct kernel_queue *kq;
> int num_queues = 0;
> struct queue *cur;
> + enum kfd_queue_type type = properties->type;
>
> - memcpy(&q_properties, properties, sizeof(struct queue_properties));
> q = NULL;
> kq = NULL;
>
> @@ -206,7 +203,7 @@ int pqm_create_queue(struct process_queue_manager *pqm,
> goto err_create_queue;
> }
>
> - retval = create_cp_queue(pqm, dev, &q, &q_properties, f, *qid);
> + retval = create_cp_queue(pqm, dev, &q, properties, f, *qid);
> if (retval != 0)
> goto err_create_queue;
> pqn->q = q;
> @@ -243,9 +240,8 @@ int pqm_create_queue(struct process_queue_manager *pqm,
> list_add(&pqn->process_queue_list, &pqm->queues);
>
> if (q) {
> - *properties = q->properties;
> pr_debug("PQM done creating queue\n");
> - print_queue_properties(properties);
> + print_queue_properties(&q->properties);
> }
>
> return retval;
> --
> 2.7.4
>
This patch is:
Reviewed-by: Oded Gabbay <oded.gabbay at gmail.com>
More information about the amd-gfx
mailing list