From 6246caa643bf0be8be1bcdabd7522f9b82aa8c98 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Wed, 15 Nov 2023 10:36:47 +0100 Subject: [PATCH] llext: (cosmetic) rename a variable to match its role str_cnt in llext_find_tables() is actually used to count sections, rename it to better match that usage. Signed-off-by: Guennadi Liakhovetski --- subsys/llext/llext.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/subsys/llext/llext.c b/subsys/llext/llext.c index 4d0cedef01e..fcaa2317c41 100644 --- a/subsys/llext/llext.c +++ b/subsys/llext/llext.c @@ -90,7 +90,7 @@ const void * const llext_find_sym(const struct llext_symtable *sym_table, const */ static int llext_find_tables(struct llext_loader *ldr) { - int str_cnt, i, ret; + int sect_cnt, i, ret; size_t pos; elf_shdr_t shdr; @@ -99,8 +99,8 @@ static int llext_find_tables(struct llext_loader *ldr) ldr->sects[LLEXT_SECT_SYMTAB] = (elf_shdr_t){0}; /* Find symbol and string tables */ - for (i = 0, str_cnt = 0, pos = ldr->hdr.e_shoff; - i < ldr->hdr.e_shnum && str_cnt < 3; + for (i = 0, sect_cnt = 0, pos = ldr->hdr.e_shoff; + i < ldr->hdr.e_shnum && sect_cnt < 3; i++, pos += ldr->hdr.e_shentsize) { ret = llext_seek(ldr, pos); if (ret != 0) { @@ -129,7 +129,7 @@ static int llext_find_tables(struct llext_loader *ldr) LOG_DBG("symtab at %d", i); ldr->sects[LLEXT_SECT_SYMTAB] = shdr; ldr->sect_map[i] = LLEXT_SECT_SYMTAB; - str_cnt++; + sect_cnt++; break; case SHT_STRTAB: if (ldr->hdr.e_shstrndx == i) { @@ -141,7 +141,7 @@ static int llext_find_tables(struct llext_loader *ldr) ldr->sects[LLEXT_SECT_STRTAB] = shdr; ldr->sect_map[i] = LLEXT_SECT_STRTAB; } - str_cnt++; + sect_cnt++; break; default: break;