Skip to content

atomic: fix atomic_add_unless() fallback's return value

Eric Engestrom requested to merge eric/libdrm:atomic_add_unless into main

According to the kernel documentation:

Returns non-zero if @v was not @u, and zero otherwise.

Fixes: 63fc5718 ("atomic: add atomic_add_unless()")
Closes: #17 (closed)
Signed-off-by: David Shao <davshao@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>

[Eric: fix its callers to maintain current behaviour]
Signed-off-by: Eric Engestrom <eric@engestrom.ch>


The intel part of this patch looks like a big change, but if you remove all the whitespace, it's simply returning when it would've gone into the branch, thereby reversing it.

Merge request reports