Re: [PATCH] ath10k: sdio: remove reduntant check in for loop

2020-09-16 Thread Alex Dewar
[snip] 'i' is only referenced once inside the loop to check boundary, the loop is actually iterating over cur_section, so i would make it clear in the loop statement, e.g.: Remove the break condition and the cur_section assignment at the end of the loop and use the loop statement to do it for

Re: [PATCH] ath10k: sdio: remove reduntant check in for loop

2020-09-14 Thread Saeed Mahameed
On Mon, 2020-09-14 at 20:19 +0100, Alex Dewar wrote: > The for loop checks whether cur_section is NULL on every iteration, > but > we know it can never be NULL as there is another check towards the > bottom of the loop body. Remove this unnecessary check. > > Also change i to start at 1, so that

[PATCH] ath10k: sdio: remove reduntant check in for loop

2020-09-14 Thread Alex Dewar
The for loop checks whether cur_section is NULL on every iteration, but we know it can never be NULL as there is another check towards the bottom of the loop body. Remove this unnecessary check. Also change i to start at 1, so that we don't need an extra +1 when we use it. Addresses-Coverity: