[3/4] amdkfd: Add some missing memset zero'ing in queue init func

Submitted by Edward O'Callaghan on Sept. 3, 2016, 2:49 a.m.

Details

Message ID 1472870947-11300-4-git-send-email-funfunctor@folklore1984.net
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Edward O'Callaghan Sept. 3, 2016, 2:49 a.m.
Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net>
---
 drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c
index 9beae87..fa23342 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c
@@ -38,8 +38,8 @@  static bool initialize(struct kernel_queue *kq, struct kfd_dev *dev,
 		enum kfd_queue_type type, unsigned int queue_size)
 {
 	struct queue_properties prop;
-	int retval;
 	union PM4_MES_TYPE_3_HEADER nop;
+	int retval;
 
 	BUG_ON(!kq || !dev);
 	BUG_ON(type != KFD_QUEUE_TYPE_DIQ && type != KFD_QUEUE_TYPE_HIQ);
@@ -47,6 +47,9 @@  static bool initialize(struct kernel_queue *kq, struct kfd_dev *dev,
 	pr_debug("amdkfd: In func %s initializing queue type %d size %d\n",
 			__func__, KFD_QUEUE_TYPE_HIQ, queue_size);
 
+	memset(&prop, 0, sizeof(prop));
+	memset(&nop, 0, sizeof(nop));
+
 	nop.opcode = IT_NOP;
 	nop.type = PM4_TYPE_3;
 	nop.u32all |= PM4_COUNT_ZERO;

Comments

On Sat, Sep 3, 2016 at 5:49 AM, Edward O'Callaghan
<funfunctor@folklore1984.net> wrote:
> Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net>
> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c
> index 9beae87..fa23342 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c
> @@ -38,8 +38,8 @@ static bool initialize(struct kernel_queue *kq, struct kfd_dev *dev,
>                 enum kfd_queue_type type, unsigned int queue_size)
>  {
>         struct queue_properties prop;
> -       int retval;
>         union PM4_MES_TYPE_3_HEADER nop;
> +       int retval;

This change is not necessary.
>
>         BUG_ON(!kq || !dev);
>         BUG_ON(type != KFD_QUEUE_TYPE_DIQ && type != KFD_QUEUE_TYPE_HIQ);
> @@ -47,6 +47,9 @@ static bool initialize(struct kernel_queue *kq, struct kfd_dev *dev,
>         pr_debug("amdkfd: In func %s initializing queue type %d size %d\n",
>                         __func__, KFD_QUEUE_TYPE_HIQ, queue_size);
>
> +       memset(&prop, 0, sizeof(prop));
> +       memset(&nop, 0, sizeof(nop));
> +
>         nop.opcode = IT_NOP;
>         nop.type = PM4_TYPE_3;
>         nop.u32all |= PM4_COUNT_ZERO;
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

With the above comment, this patch is:
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>