Skip to contentSkip to conversation

amdgpu: use EINVAL instead of EBADMSG in amdgpu_bo_cpu_unmap()

PATCH In review Jonathan Gray 3 participants 3 messages Sep 1, 2015 – Sep 2, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 amdgpu: use EINVAL instead of EBADMSG in amdgpu_bo_cpu_unmap()

EBADMSG is a streams errno. OpenBSD does not implement streams and does include the streams errnos, this commit fixes the build on OpenBSD.

None of the callers of this function check the return value for -EBADMSG.

---
 amdgpu/amdgpu_bo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
amdgpu/amdgpu_bo.c +1 -1
index 220422d..348da00 100644
@@ -482,7 +482,7 @@ int amdgpu_bo_cpu_unmap(amdgpu_bo_handle bo)
 	if (bo->cpu_map_count == 0) {
 		/* not mapped */
 		pthread_mutex_unlock(&bo->cpu_access_mutex);
-		return -EBADMSG;
+		return -EINVAL;
 	}
 
 	bo->cpu_map_count--;
Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 6 lines · Jonathan Gray

EBADMSG is a streams errno. OpenBSD does not implement streams and does include the streams errnos, this commit fixes the build on OpenBSD.

None of the callers of this function check the return value for -EBADMSG.

Probably not intentional to use this error code here.

Patch is Reviewed-by: Christian König <[email protected]>

Regards,
Christian.

Quoted 9 lines
---
  amdgpu/amdgpu_bo.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
amdgpu/amdgpu_bo.c +0 -0
index 220422d..348da00 100644

amdgpu/amdgpu_bo.c int amdgpu_bo_cpu_unmap(amdgpu_bo_handle bo) · line 488

Quoted 8 lines
amdgpu/amdgpu_bo.c +1 -1
@@ -482,7 +482,7 @@ int amdgpu_bo_cpu_unmap(amdgpu_bo_handle bo)
  	if (bo->cpu_map_count == 0) {
  		/* not mapped */
  		pthread_mutex_unlock(&bo->cpu_access_mutex);
-		return -EBADMSG;
+		return -EINVAL;
  	}
 
  	bo->cpu_map_count--;

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
Quoted 5 lines · Christian König
Quoted 4 lines · Jonathan Gray

EBADMSG is a streams errno. OpenBSD does not implement streams and does include the streams errnos, this commit fixes the build on OpenBSD.

Quoted 8 lines
Quoted 3 lines

None of the callers of this function check the return value for -EBADMSG.

Probably not intentional to use this error code here.

Patch is Reviewed-by: Christian König <[email protected]>

Pushed!

Alex

Quoted 18 lines

Regards,
Christian.

Quoted 14 lines
---
  amdgpu/amdgpu_bo.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
amdgpu/amdgpu_bo.c +1 -1
index 220422d..348da00 100644
@@ -482,7 +482,7 @@ int amdgpu_bo_cpu_unmap(amdgpu_bo_handle bo)
        if (bo->cpu_map_count == 0) {
                /* not mapped */
                pthread_mutex_unlock(&bo->cpu_access_mutex);
-               return -EBADMSG;
+               return -EINVAL;
Quoted 8 lines

amdgpu/amdgpu_bo.c int amdgpu_bo_cpu_unmap(amdgpu_bo_handle bo) · line 488

Quoted 2 lines
amdgpu/amdgpu_bo.c +0 -0
        }
        bo->cpu_map_count--;

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel