Serious error in the code
Hello,
During porting we found a serious error:
Function
static inline int __atomic_add_unless(atomic_t *v, int a, int u) is implemented wrong.
Hexagon implementation returns 0 or 1, while it _must_ return old value.
linux/atomic.h defines it as:
static inline int atomic_add_unless(atomic_t *v, int a, int u)
{
return __atomic_add_unless(v, a, u) != u;
}So it's really supposed for __atomic_add_unless return old value, not 0/1 flag. And finally atomic_add_unless returns 0/1 flag by comparing values.
I think developer was confused by atomic_add_unless() description which is different from __atomic_add_unless().
This was a very awful error. . .dunno how it worked before.
However this is not the first error in the code - for example hexagon_dma_init() is never called outside.
I am really surprised that this was ever included to mainline. Dead, not working code with a lot of errors for some abstract private HVM.
Best regards,
-Cotulla