lkml.org 
[lkml]   [2018]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 2/4] Renames variable to fix shadow warning.
On Tue, Oct 16, 2018 at 11:01 PM Ingo Molnar <mingo@kernel.org> wrote:
>
>
> * Leonardo Brás <leobras.c@gmail.com> wrote:
>
> > Renames the char variable to avoid shadowing a variable previously
> > declared on this function.
> >
> > Signed-off-by: Leonardo Brás <leobras.c@gmail.com>
> > ---
> > arch/x86/entry/vdso/vdso2c.h | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/x86/entry/vdso/vdso2c.h b/arch/x86/entry/vdso/vdso2c.h
> > index fa847a620f40..9466998d0f28 100644
> > --- a/arch/x86/entry/vdso/vdso2c.h
> > +++ b/arch/x86/entry/vdso/vdso2c.h
> > @@ -93,11 +93,11 @@ static void BITSFUNC(go)(void *raw_addr, size_t raw_len,
> > int k;
> > ELF(Sym) *sym = raw_addr + GET_LE(&symtab_hdr->sh_offset) +
> > GET_LE(&symtab_hdr->sh_entsize) * i;
> > - const char *name = raw_addr + GET_LE(&strtab_hdr->sh_offset) +
> > + const char *name2 = raw_addr + GET_LE(&strtab_hdr->sh_offset) +
> > GET_LE(&sym->st_name);
> >
> > for (k = 0; k < NSYMS; k++) {
> > - if (!strcmp(name, required_syms[k].name)) {
> > + if (!strcmp(name2, required_syms[k].name)) {
> > if (syms[k]) {
> > fail("duplicate symbol %s\n",
> > required_syms[k].name);
>
> NAK.
>
> Please read and understand the code and rename both variables to
> meaningful names, not just a mindless name/name2 ...
>

Maybe image_name and sym_name?

--Andy

\
 
 \ /
  Last update: 2018-10-17 19:55    [W:0.057 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site