As sizeof(str) already includes the '\0', we should not add 1
on the return size. Conformance case computeinfo could pass with
this patch.

(28-Aug 16:51:00)     BEGIN  Compute Info                            :
           ==>  CL_DEVICE_ERROR_CORRECTION_SUPPORT == 0
           ==>  CL_DEVICE_ERROR_CORRECTION_SUPPORT == 0
           ==>  CL_DEVICE_ERROR_CORRECTION_SUPPORT == 0
               PASSED computeinfo.

Signed-off-by: Zhigang Gong <[email protected]>
---
 src/cl_platform_id.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/cl_platform_id.c b/src/cl_platform_id.c
index 33915ce..fdf0d78 100644
--- a/src/cl_platform_id.c
+++ b/src/cl_platform_id.c
@@ -28,7 +28,7 @@
 
 #define DECL_INFO_STRING(FIELD, STRING) \
     .FIELD = STRING,                    \
-    .JOIN(FIELD,_sz) = sizeof(STRING) + 1,
+    .JOIN(FIELD,_sz) = sizeof(STRING),
 
 static struct _cl_platform_id intel_platform_data = {
   INIT_ICD(dispatch)
-- 
1.7.9.5

_______________________________________________
Beignet mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/beignet

Reply via email to