[PATCH 12/14] drm/amdkfd: Reduce nesting in kfd_create_process_device_data
Oded Gabbay
oded.gabbay at gmail.com
Sun Dec 10 10:13:37 UTC 2017
On Tue, Nov 28, 2017 at 1:29 AM, Felix Kuehling <Felix.Kuehling at amd.com> wrote:
> Signed-off-by: Felix Kuehling <Felix.Kuehling at amd.com>
> ---
> drivers/gpu/drm/amd/amdkfd/kfd_process.c | 23 ++++++++++++-----------
> 1 file changed, 12 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
> index 93f9019..88fc822 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
> @@ -390,17 +390,18 @@ struct kfd_process_device *kfd_create_process_device_data(struct kfd_dev *dev,
> struct kfd_process_device *pdd = NULL;
>
> pdd = kzalloc(sizeof(*pdd), GFP_KERNEL);
> - if (pdd != NULL) {
> - pdd->dev = dev;
> - INIT_LIST_HEAD(&pdd->qpd.queues_list);
> - INIT_LIST_HEAD(&pdd->qpd.priv_queue_list);
> - pdd->qpd.dqm = dev->dqm;
> - pdd->qpd.pqm = &p->pqm;
> - pdd->process = p;
> - pdd->bound = PDD_UNBOUND;
> - pdd->already_dequeued = false;
> - list_add(&pdd->per_device_list, &p->per_device_data);
> - }
> + if (!pdd)
> + return NULL;
> +
> + pdd->dev = dev;
> + INIT_LIST_HEAD(&pdd->qpd.queues_list);
> + INIT_LIST_HEAD(&pdd->qpd.priv_queue_list);
> + pdd->qpd.dqm = dev->dqm;
> + pdd->qpd.pqm = &p->pqm;
> + pdd->process = p;
> + pdd->bound = PDD_UNBOUND;
> + pdd->already_dequeued = false;
> + list_add(&pdd->per_device_list, &p->per_device_data);
>
> return pdd;
> }
> --
> 2.7.4
>
This patch is:
Reviewed-by: Oded Gabbay <oded.gabbay at gmail.com>
More information about the amd-gfx
mailing list