diff options
author | Kent Russell | 2017-08-16 05:00:08 +0200 |
---|---|---|
committer | Oded Gabbay | 2017-08-16 05:00:08 +0200 |
commit | dbf56ab11a09550c00edb84fc4b2197350154e99 (patch) | |
tree | 67342d776471888f326568b990c2e70b34d5874d /drivers/gpu/drm/amd/amdkfd/kfd_queue.c | |
parent | drm/amdkfd: Fix goto usage v2 (diff) | |
download | kernel-qcow2-linux-dbf56ab11a09550c00edb84fc4b2197350154e99.tar.gz kernel-qcow2-linux-dbf56ab11a09550c00edb84fc4b2197350154e99.tar.xz kernel-qcow2-linux-dbf56ab11a09550c00edb84fc4b2197350154e99.zip |
drm/amdkfd: Remove usage of alloc(sizeof(struct...
See https://kernel.org/doc/html/latest/process/coding-style.html
under "14) Allocating Memory" for rationale behind removing the
x=alloc(sizeof(struct) style and using x=alloc(sizeof(*x) instead
Signed-off-by: Kent Russell <kent.russell@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdkfd/kfd_queue.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_queue.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_queue.c b/drivers/gpu/drm/amd/amdkfd/kfd_queue.c index 0ab197077f2d..5ad9f6f192ae 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_queue.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_queue.c @@ -65,17 +65,17 @@ void print_queue(struct queue *q) int init_queue(struct queue **q, const struct queue_properties *properties) { - struct queue *tmp; + struct queue *tmp_q; BUG_ON(!q); - tmp = kzalloc(sizeof(struct queue), GFP_KERNEL); - if (!tmp) + tmp_q = kzalloc(sizeof(*tmp_q), GFP_KERNEL); + if (!tmp_q) return -ENOMEM; - memcpy(&tmp->properties, properties, sizeof(struct queue_properties)); + memcpy(&tmp_q->properties, properties, sizeof(*properties)); - *q = tmp; + *q = tmp_q; return 0; } |