On 11/02/2022 12:57, Damien Le Moal wrote:
I thought the current code was ok, as we init n_elem = 0 and we only
ever loop once. Am I missing something?
It was not clear to me because of the loop. If the loop is done only
once, why the loop in the first place ?
Hold on...
Oh ! It is a while(0)... OK, this too ugly to live.
I didn't see the point of the while (0) loop at all.
We need to do
something about this. The continue at the beginning of the loop seems
totally crazy as it may lead to the same task being reused, so multiple
->task_done() calls for the same task. Is that sane ?
No.
And I think continue in while(0) has has effect as break - it falls out.
Thanks,
John