Skip to content
Commit a88facac authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Fabio Baltieri
Browse files

llext: clarify the use of loop variables, simplify code



Several cosmetic changes with no change in functionality:

The pos variable in multiple functions is used as a loop variable -
it's initialised before the loop starts and then it's incremented for
each loop iteration. Move it to the loop header for readability.

"return ret" is clearer than "goto out" where the "out" label does
nothing but "out: return ret" because one sees immediately that the
function is terminated at that location with no further actions
without the need to check the "out" label.

k_heap_free(heap, NULL) is valid, no need to check the address to be
freed for NULL.

Object counters can be simple (unsigned) integers, no need to make
them size_t or elf_word.

"return 0" is simpler than "return ret" because it shows the return
value immediately without the need to check what it can be at that
location.

Signed-off-by: default avatarGuennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
parent e9104091
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment