On Tue, Oct 12, 2021 at 8:55 PM Joe Perches <joe@xxxxxxxxxxx> wrote:I think in alloc path is using for loop, and in error/free path also using for loop is better to read the code.
On Tue, 2021-10-12 at 23:48 +0300, Andy Shevchenko wrote:...
On Tue, Oct 12, 2021 at 8:43 PM Joe Perches <joe@xxxxxxxxxxx> wrote:
On Tue, 2021-10-12 at 23:30 +0300, Andy Shevchenko wrote:
On Tue, Oct 12, 2021 at 2:37 PM Alexandru Ardelean
<ardeleanalex@xxxxxxxxx> wrote:
On Tue, Oct 12, 2021 at 12:18 PM Yang Yingliang
<yangyingliang@xxxxxxxxxx> wrote:
It's. It lacks the very same "additional" words to explain what youNot really,It's kinda cryptic what you are pointing out.I prefer to seeNot the same code as unwind_idx would be decremented before entering
- for (; unwind_idx >= 0; unwind_idx--) {
+ while (unwind_idx--)
the code block.
meant and why.
Yes, that's true, but it took some time to decrypt your message.What's needed additionally is to changeYou left out that 'additional change' above from your reply.
- unwind_idx = iio_dev_opaque->attached_buffers_cnt - 1;
+ unwind_idx = i;
I expect that developers actually think about the changes they do andOf course not. See above. The usual pattern isOf course, but that's not what you replied.
while (i--)
do_clean_item(i);
I was merely pointing out that your reply included a logic change
converting a loop from for to while.
double check what's proposed by reviewers. If they just copy'n'paste
whatever others propose, I wouldn't take any patch from such a
developer.