Re: [PATCH 2/4] Renames variable to fix shadow warning.

2018-10-17 Thread Ingo Molnar


* Leonardo Bras  wrote:

> Thanks Ingo,
> On Wed, Oct 17, 2018 at 3:01 AM Ingo Molnar  wrote:
> >
> >
> > * Leonardo Brás  wrote:
> >
> > > Renames the char variable to avoid shadowing a variable previously
> > > declared on this function.
> > >
> > > Signed-off-by: Leonardo Brás 
> > > ---
> > >  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(_hdr->sh_offset) +
> > >   GET_LE(_hdr->sh_entsize) * i;
> > > - const char *name = raw_addr + 
> > > GET_LE(_hdr->sh_offset) +
> > > + const char *name2 = raw_addr + 
> > > GET_LE(_hdr->sh_offset) +
> > >   GET_LE(>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 ...
> >
> 
> It's changed! This change will be available on v2.

Thanks!

Ingo


Re: [PATCH 2/4] Renames variable to fix shadow warning.

2018-10-17 Thread Ingo Molnar


* Leonardo Bras  wrote:

> Thanks Ingo,
> On Wed, Oct 17, 2018 at 3:01 AM Ingo Molnar  wrote:
> >
> >
> > * Leonardo Brás  wrote:
> >
> > > Renames the char variable to avoid shadowing a variable previously
> > > declared on this function.
> > >
> > > Signed-off-by: Leonardo Brás 
> > > ---
> > >  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(_hdr->sh_offset) +
> > >   GET_LE(_hdr->sh_entsize) * i;
> > > - const char *name = raw_addr + 
> > > GET_LE(_hdr->sh_offset) +
> > > + const char *name2 = raw_addr + 
> > > GET_LE(_hdr->sh_offset) +
> > >   GET_LE(>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 ...
> >
> 
> It's changed! This change will be available on v2.

Thanks!

Ingo


Re: [PATCH 2/4] Renames variable to fix shadow warning.

2018-10-17 Thread Leonardo Bras
Hello Andy,
Thanks for the suggestion.
I renamed them as suggested and it will be available on v2.

Regards,

Leonardo

On Wed, Oct 17, 2018 at 2:54 PM Andy Lutomirski  wrote:
>
> On Tue, Oct 16, 2018 at 11:01 PM Ingo Molnar  wrote:
> >
> >
> > * Leonardo Brás  wrote:
> >
> > > Renames the char variable to avoid shadowing a variable previously
> > > declared on this function.
> > >
> > > Signed-off-by: Leonardo Brás 
> > > ---
> > >  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(_hdr->sh_offset) +
> > >   GET_LE(_hdr->sh_entsize) * i;
> > > - const char *name = raw_addr + 
> > > GET_LE(_hdr->sh_offset) +
> > > + const char *name2 = raw_addr + 
> > > GET_LE(_hdr->sh_offset) +
> > >   GET_LE(>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


Re: [PATCH 2/4] Renames variable to fix shadow warning.

2018-10-17 Thread Leonardo Bras
Hello Andy,
Thanks for the suggestion.
I renamed them as suggested and it will be available on v2.

Regards,

Leonardo

On Wed, Oct 17, 2018 at 2:54 PM Andy Lutomirski  wrote:
>
> On Tue, Oct 16, 2018 at 11:01 PM Ingo Molnar  wrote:
> >
> >
> > * Leonardo Brás  wrote:
> >
> > > Renames the char variable to avoid shadowing a variable previously
> > > declared on this function.
> > >
> > > Signed-off-by: Leonardo Brás 
> > > ---
> > >  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(_hdr->sh_offset) +
> > >   GET_LE(_hdr->sh_entsize) * i;
> > > - const char *name = raw_addr + 
> > > GET_LE(_hdr->sh_offset) +
> > > + const char *name2 = raw_addr + 
> > > GET_LE(_hdr->sh_offset) +
> > >   GET_LE(>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


Re: [PATCH 2/4] Renames variable to fix shadow warning.

2018-10-17 Thread Leonardo Bras
Thanks Ingo,
On Wed, Oct 17, 2018 at 3:01 AM Ingo Molnar  wrote:
>
>
> * Leonardo Brás  wrote:
>
> > Renames the char variable to avoid shadowing a variable previously
> > declared on this function.
> >
> > Signed-off-by: Leonardo Brás 
> > ---
> >  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(_hdr->sh_offset) +
> >   GET_LE(_hdr->sh_entsize) * i;
> > - const char *name = raw_addr + GET_LE(_hdr->sh_offset) +
> > + const char *name2 = raw_addr + GET_LE(_hdr->sh_offset) 
> > +
> >   GET_LE(>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 ...
>

It's changed! This change will be available on v2.

> Thanks,
>
> Ingo

Regards,
Leonardo


Re: [PATCH 2/4] Renames variable to fix shadow warning.

2018-10-17 Thread Leonardo Bras
Thanks Ingo,
On Wed, Oct 17, 2018 at 3:01 AM Ingo Molnar  wrote:
>
>
> * Leonardo Brás  wrote:
>
> > Renames the char variable to avoid shadowing a variable previously
> > declared on this function.
> >
> > Signed-off-by: Leonardo Brás 
> > ---
> >  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(_hdr->sh_offset) +
> >   GET_LE(_hdr->sh_entsize) * i;
> > - const char *name = raw_addr + GET_LE(_hdr->sh_offset) +
> > + const char *name2 = raw_addr + GET_LE(_hdr->sh_offset) 
> > +
> >   GET_LE(>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 ...
>

It's changed! This change will be available on v2.

> Thanks,
>
> Ingo

Regards,
Leonardo


Re: [Lkcamp] [PATCH 2/4] Renames variable to fix shadow warning.

2018-10-17 Thread Leonardo Bras
Hello Helen,
Thanks for the suggestions!

On Tue, Oct 16, 2018 at 11:57 PM Helen Koike  wrote:
>
> Hi Leonardo,
>
> Thanks for the patch, just some small comments below.
>
> Please, check previous log messages with git log
> arch/x86/entry/vdso/vdso2c.h, you will see that most patches had the
> prefix "x86/vdso:" in the commit message.
Ok, added! This change will be available on v2.

>
> On 10/16/18 9:08 PM, Leonardo Brás wrote:
> > Renames the char variable to avoid shadowing a variable previously
> > declared on this function.
> >
> > Signed-off-by: Leonardo Brás 
> > ---
> >  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(_hdr->sh_offset) +
> >   GET_LE(_hdr->sh_entsize) * i;
> > - const char *name = raw_addr + GET_LE(_hdr->sh_offset) +
> > + const char *name2 = raw_addr + GET_LE(_hdr->sh_offset) 
> > +
> >   GET_LE(>st_name);
>
> Could you please use a more meaningful name instead of name2 please? I
> believe sym_name should be fine.

Ok, I renamed as you suggested.
Also, I renamed the "name" variable to "image_name" as Andy suggested.
This change will be available on v2.

>
> >
> >   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);
> >
>
> Regards
> Helen

Regards,
Leonardo Bras


Re: [Lkcamp] [PATCH 2/4] Renames variable to fix shadow warning.

2018-10-17 Thread Leonardo Bras
Hello Helen,
Thanks for the suggestions!

On Tue, Oct 16, 2018 at 11:57 PM Helen Koike  wrote:
>
> Hi Leonardo,
>
> Thanks for the patch, just some small comments below.
>
> Please, check previous log messages with git log
> arch/x86/entry/vdso/vdso2c.h, you will see that most patches had the
> prefix "x86/vdso:" in the commit message.
Ok, added! This change will be available on v2.

>
> On 10/16/18 9:08 PM, Leonardo Brás wrote:
> > Renames the char variable to avoid shadowing a variable previously
> > declared on this function.
> >
> > Signed-off-by: Leonardo Brás 
> > ---
> >  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(_hdr->sh_offset) +
> >   GET_LE(_hdr->sh_entsize) * i;
> > - const char *name = raw_addr + GET_LE(_hdr->sh_offset) +
> > + const char *name2 = raw_addr + GET_LE(_hdr->sh_offset) 
> > +
> >   GET_LE(>st_name);
>
> Could you please use a more meaningful name instead of name2 please? I
> believe sym_name should be fine.

Ok, I renamed as you suggested.
Also, I renamed the "name" variable to "image_name" as Andy suggested.
This change will be available on v2.

>
> >
> >   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);
> >
>
> Regards
> Helen

Regards,
Leonardo Bras


Re: [PATCH 2/4] Renames variable to fix shadow warning.

2018-10-17 Thread Andy Lutomirski
On Tue, Oct 16, 2018 at 11:01 PM Ingo Molnar  wrote:
>
>
> * Leonardo Brás  wrote:
>
> > Renames the char variable to avoid shadowing a variable previously
> > declared on this function.
> >
> > Signed-off-by: Leonardo Brás 
> > ---
> >  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(_hdr->sh_offset) +
> >   GET_LE(_hdr->sh_entsize) * i;
> > - const char *name = raw_addr + GET_LE(_hdr->sh_offset) +
> > + const char *name2 = raw_addr + GET_LE(_hdr->sh_offset) 
> > +
> >   GET_LE(>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


Re: [PATCH 2/4] Renames variable to fix shadow warning.

2018-10-17 Thread Andy Lutomirski
On Tue, Oct 16, 2018 at 11:01 PM Ingo Molnar  wrote:
>
>
> * Leonardo Brás  wrote:
>
> > Renames the char variable to avoid shadowing a variable previously
> > declared on this function.
> >
> > Signed-off-by: Leonardo Brás 
> > ---
> >  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(_hdr->sh_offset) +
> >   GET_LE(_hdr->sh_entsize) * i;
> > - const char *name = raw_addr + GET_LE(_hdr->sh_offset) +
> > + const char *name2 = raw_addr + GET_LE(_hdr->sh_offset) 
> > +
> >   GET_LE(>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


Re: [PATCH 2/4] Renames variable to fix shadow warning.

2018-10-17 Thread Ingo Molnar


* Leonardo Brás  wrote:

> Renames the char variable to avoid shadowing a variable previously
> declared on this function.
> 
> Signed-off-by: Leonardo Brás 
> ---
>  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(_hdr->sh_offset) +
>   GET_LE(_hdr->sh_entsize) * i;
> - const char *name = raw_addr + GET_LE(_hdr->sh_offset) +
> + const char *name2 = raw_addr + GET_LE(_hdr->sh_offset) +
>   GET_LE(>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 ...

Thanks,

Ingo


Re: [PATCH 2/4] Renames variable to fix shadow warning.

2018-10-17 Thread Ingo Molnar


* Leonardo Brás  wrote:

> Renames the char variable to avoid shadowing a variable previously
> declared on this function.
> 
> Signed-off-by: Leonardo Brás 
> ---
>  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(_hdr->sh_offset) +
>   GET_LE(_hdr->sh_entsize) * i;
> - const char *name = raw_addr + GET_LE(_hdr->sh_offset) +
> + const char *name2 = raw_addr + GET_LE(_hdr->sh_offset) +
>   GET_LE(>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 ...

Thanks,

Ingo


Re: [Lkcamp] [PATCH 2/4] Renames variable to fix shadow warning.

2018-10-16 Thread Helen Koike
Hi Leonardo,

Thanks for the patch, just some small comments below.

Please, check previous log messages with git log
arch/x86/entry/vdso/vdso2c.h, you will see that most patches had the
prefix "x86/vdso:" in the commit message.

On 10/16/18 9:08 PM, Leonardo Brás wrote:
> Renames the char variable to avoid shadowing a variable previously
> declared on this function.
> 
> Signed-off-by: Leonardo Brás 
> ---
>  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(_hdr->sh_offset) +
>   GET_LE(_hdr->sh_entsize) * i;
> - const char *name = raw_addr + GET_LE(_hdr->sh_offset) +
> + const char *name2 = raw_addr + GET_LE(_hdr->sh_offset) +
>   GET_LE(>st_name);

Could you please use a more meaningful name instead of name2 please? I
believe sym_name should be fine.

>  
>   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);
> 

Regards
Helen


Re: [Lkcamp] [PATCH 2/4] Renames variable to fix shadow warning.

2018-10-16 Thread Helen Koike
Hi Leonardo,

Thanks for the patch, just some small comments below.

Please, check previous log messages with git log
arch/x86/entry/vdso/vdso2c.h, you will see that most patches had the
prefix "x86/vdso:" in the commit message.

On 10/16/18 9:08 PM, Leonardo Brás wrote:
> Renames the char variable to avoid shadowing a variable previously
> declared on this function.
> 
> Signed-off-by: Leonardo Brás 
> ---
>  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(_hdr->sh_offset) +
>   GET_LE(_hdr->sh_entsize) * i;
> - const char *name = raw_addr + GET_LE(_hdr->sh_offset) +
> + const char *name2 = raw_addr + GET_LE(_hdr->sh_offset) +
>   GET_LE(>st_name);

Could you please use a more meaningful name instead of name2 please? I
believe sym_name should be fine.

>  
>   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);
> 

Regards
Helen


[PATCH 2/4] Renames variable to fix shadow warning.

2018-10-16 Thread Leonardo Brás
Renames the char variable to avoid shadowing a variable previously
declared on this function.

Signed-off-by: Leonardo Brás 
---
 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(_hdr->sh_offset) +
GET_LE(_hdr->sh_entsize) * i;
-   const char *name = raw_addr + GET_LE(_hdr->sh_offset) +
+   const char *name2 = raw_addr + GET_LE(_hdr->sh_offset) +
GET_LE(>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);
-- 
2.19.1



[PATCH 2/4] Renames variable to fix shadow warning.

2018-10-16 Thread Leonardo Brás
Renames the char variable to avoid shadowing a variable previously
declared on this function.

Signed-off-by: Leonardo Brás 
---
 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(_hdr->sh_offset) +
GET_LE(_hdr->sh_entsize) * i;
-   const char *name = raw_addr + GET_LE(_hdr->sh_offset) +
+   const char *name2 = raw_addr + GET_LE(_hdr->sh_offset) +
GET_LE(>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);
-- 
2.19.1