diff mbox

[libdrm] amdgpu: use EINVAL instead of EBADMSG in amdgpu_bo_cpu_unmap()

Message ID 1441107439-30944-1-git-send-email-jsg@jsg.id.au (mailing list archive)
State New, archived
Headers show

Commit Message

Jonathan Gray Sept. 1, 2015, 11:37 a.m. UTC
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.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
---
 amdgpu/amdgpu_bo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christian König Sept. 1, 2015, 1:07 p.m. UTC | #1
On 01.09.2015 13:37, Jonathan Gray wrote:
> 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.
>
> Signed-off-by: Jonathan Gray <jsg@jsg.id.au>

Probably not intentional to use this error code here.

Patch is Reviewed-by: Christian König <christian.koenig@amd.com>

Regards,
Christian.

> ---
>   amdgpu/amdgpu_bo.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c
> index 220422d..348da00 100644
> --- a/amdgpu/amdgpu_bo.c
> +++ b/amdgpu/amdgpu_bo.c
> @@ -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--;
Alex Deucher Sept. 2, 2015, 8:24 p.m. UTC | #2
On Tue, Sep 1, 2015 at 9:07 AM, Christian König <deathsimple@vodafone.de> wrote:
> On 01.09.2015 13:37, Jonathan Gray wrote:
>>
>> 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.
>>
>> Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
>
>
> Probably not intentional to use this error code here.
>
> Patch is Reviewed-by: Christian König <christian.koenig@amd.com>

Pushed!

Alex

>
> Regards,
> Christian.
>
>> ---
>>   amdgpu/amdgpu_bo.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c
>> index 220422d..348da00 100644
>> --- a/amdgpu/amdgpu_bo.c
>> +++ b/amdgpu/amdgpu_bo.c
>> @@ -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
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c
index 220422d..348da00 100644
--- a/amdgpu/amdgpu_bo.c
+++ b/amdgpu/amdgpu_bo.c
@@ -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--;