Runtime: fix a build warning.

Submitted by Yang, Rong R on July 12, 2017, 10:33 a.m.

Details

Message ID 1499855592-17536-1-git-send-email-rong.r.yang@intel.com
State New
Series "Runtime: fix a build warning."
Headers show

Commit Message

Yang, Rong R July 12, 2017, 10:33 a.m.
Signed-off-by: Yang Rong <rong.r.yang@intel.com>
---
 src/cl_program.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/cl_program.c b/src/cl_program.c
index 556b041..3cb5906 100644
--- a/src/cl_program.c
+++ b/src/cl_program.c
@@ -371,6 +371,7 @@  cl_program_create_with_built_in_kernles(cl_context     ctx,
                                   cl_int *             errcode_ret)
 {
   cl_int err = CL_SUCCESS;
+  cl_program built_in_prgs = NULL;
 
   assert(ctx);
   INVALID_DEVICE_IF (num_devices != 1);
@@ -382,11 +383,11 @@  cl_program_create_with_built_in_kernles(cl_context     ctx,
   extern size_t cl_internal_built_in_kernel_str_size;
   char* p_built_in_kernel_str =cl_internal_built_in_kernel_str;
 
-  cl_program built_in_prgs = cl_program_create_from_binary(ctx, 1,
-                                                          &ctx->devices[0],
-                                                          (size_t*)&cl_internal_built_in_kernel_str_size,
-                                                          (const unsigned char **)&p_built_in_kernel_str,
-                                                          &binary_status, &err);
+  built_in_prgs = cl_program_create_from_binary(ctx, 1,
+                                                &ctx->devices[0],
+                                                (size_t*)&cl_internal_built_in_kernel_str_size,
+                                                (const unsigned char **)&p_built_in_kernel_str,
+                                                &binary_status, &err);
   if (!built_in_prgs)
     return NULL;
 

Comments

Song, Ruiling July 27, 2017, 6:33 a.m.
LGTM

Ruiling

> -----Original Message-----

> From: Beignet [mailto:beignet-bounces@lists.freedesktop.org] On Behalf Of

> Yang Rong

> Sent: Wednesday, July 12, 2017 6:33 PM

> To: beignet@lists.freedesktop.org

> Cc: Yang, Rong R <rong.r.yang@intel.com>

> Subject: [Beignet] [PATCH] Runtime: fix a build warning.

> 

> Signed-off-by: Yang Rong <rong.r.yang@intel.com>

> ---

>  src/cl_program.c | 11 ++++++-----

>  1 file changed, 6 insertions(+), 5 deletions(-)

> 

> diff --git a/src/cl_program.c b/src/cl_program.c

> index 556b041..3cb5906 100644

> --- a/src/cl_program.c

> +++ b/src/cl_program.c

> @@ -371,6 +371,7 @@ cl_program_create_with_built_in_kernles(cl_context

> ctx,

>                                    cl_int *             errcode_ret)

>  {

>    cl_int err = CL_SUCCESS;

> +  cl_program built_in_prgs = NULL;

> 

>    assert(ctx);

>    INVALID_DEVICE_IF (num_devices != 1);

> @@ -382,11 +383,11 @@ cl_program_create_with_built_in_kernles(cl_context

> ctx,

>    extern size_t cl_internal_built_in_kernel_str_size;

>    char* p_built_in_kernel_str =cl_internal_built_in_kernel_str;

> 

> -  cl_program built_in_prgs = cl_program_create_from_binary(ctx, 1,

> -                                                          &ctx->devices[0],

> -                                                          (size_t*)&cl_internal_built_in_kernel_str_size,

> -                                                          (const unsigned char **)&p_built_in_kernel_str,

> -                                                          &binary_status, &err);

> +  built_in_prgs = cl_program_create_from_binary(ctx, 1,

> +                                                &ctx->devices[0],

> +                                                (size_t*)&cl_internal_built_in_kernel_str_size,

> +                                                (const unsigned char **)&p_built_in_kernel_str,

> +                                                &binary_status, &err);

>    if (!built_in_prgs)

>      return NULL;

> 

> --

> 2.1.4

> 

> _______________________________________________

> Beignet mailing list

> Beignet@lists.freedesktop.org

> https://lists.freedesktop.org/mailman/listinfo/beignet