Re: [PATCH v3 4/5] modpost: Changes parameter name to avoid shadowing.

2018-10-31 Thread Leonardo Bras
Em qua, 2018-10-31 às 20:24 -0300, Leonardo Bras escreveu:
> Em seg, 2018-10-29 às 01:42 +0900, Masahiro Yamada escreveu:
> > On Wed, Oct 24, 2018 at 1:05 PM Leonardo Bras 
> > wrote:
> > > Changes the parameter name to avoid shadowing a variable.
> > > 
> > > Signed-off-by: Leonardo Bras 
> > 
> > For this one, I'd rather like to see code refactoring
> > than renaming the variable.
> > 
> > I will take a closer look.
> 
> What do you suggest to refactor?
> I volunteer for this work.
> 
> Leonardo Bras
> 

I refactored the code to move the global variable *modules to a local
context at function main, and changed the functions to accept *modules
as a parameter.

Is that what you had in mind?

https://lkml.org/lkml/2018/11/1/725

Thanks for reading,

Leonardo Bras



Re: [PATCH v3 4/5] modpost: Changes parameter name to avoid shadowing.

2018-10-31 Thread Leonardo Bras
Em qua, 2018-10-31 às 20:24 -0300, Leonardo Bras escreveu:
> Em seg, 2018-10-29 às 01:42 +0900, Masahiro Yamada escreveu:
> > On Wed, Oct 24, 2018 at 1:05 PM Leonardo Bras 
> > wrote:
> > > Changes the parameter name to avoid shadowing a variable.
> > > 
> > > Signed-off-by: Leonardo Bras 
> > 
> > For this one, I'd rather like to see code refactoring
> > than renaming the variable.
> > 
> > I will take a closer look.
> 
> What do you suggest to refactor?
> I volunteer for this work.
> 
> Leonardo Bras
> 

I refactored the code to move the global variable *modules to a local
context at function main, and changed the functions to accept *modules
as a parameter.

Is that what you had in mind?

https://lkml.org/lkml/2018/11/1/725

Thanks for reading,

Leonardo Bras



Re: [PATCH v3 4/5] modpost: Changes parameter name to avoid shadowing.

2018-10-31 Thread Leonardo Bras
Em seg, 2018-10-29 às 01:42 +0900, Masahiro Yamada escreveu:
> On Wed, Oct 24, 2018 at 1:05 PM Leonardo Bras 
> wrote:
> > Changes the parameter name to avoid shadowing a variable.
> > 
> > Signed-off-by: Leonardo Bras 
> 
> For this one, I'd rather like to see code refactoring
> than renaming the variable.
> 
> I will take a closer look.


What do you suggest to refactor?
I volunteer for this work.

Leonardo Bras



Re: [PATCH v3 4/5] modpost: Changes parameter name to avoid shadowing.

2018-10-31 Thread Leonardo Bras
Em seg, 2018-10-29 às 01:42 +0900, Masahiro Yamada escreveu:
> On Wed, Oct 24, 2018 at 1:05 PM Leonardo Bras 
> wrote:
> > Changes the parameter name to avoid shadowing a variable.
> > 
> > Signed-off-by: Leonardo Bras 
> 
> For this one, I'd rather like to see code refactoring
> than renaming the variable.
> 
> I will take a closer look.


What do you suggest to refactor?
I volunteer for this work.

Leonardo Bras



Re: [PATCH v3 4/5] modpost: Changes parameter name to avoid shadowing.

2018-10-28 Thread Masahiro Yamada
On Wed, Oct 24, 2018 at 1:05 PM Leonardo Bras  wrote:
>
> Changes the parameter name to avoid shadowing a variable.
>
> Signed-off-by: Leonardo Bras 


For this one, I'd rather like to see code refactoring
than renaming the variable.

I will take a closer look.




> ---
>  scripts/mod/modpost.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> index 0d998c54564d..368fe42340df 100644
> --- a/scripts/mod/modpost.c
> +++ b/scripts/mod/modpost.c
> @@ -2228,13 +2228,13 @@ static int add_versions(struct buffer *b, struct 
> module *mod)
>  }
>
>  static void add_depends(struct buffer *b, struct module *mod,
> -   struct module *modules)
> +   struct module *module_list)
>  {
> struct symbol *s;
> struct module *m;
> int first = 1;
>
> -   for (m = modules; m; m = m->next)
> +   for (m = module_list; m; m = m->next)
> m->seen = is_vmlinux(m->name);
>
> buf_printf(b, "\n");
> --
> 2.19.1
>


-- 
Best Regards
Masahiro Yamada


Re: [PATCH v3 4/5] modpost: Changes parameter name to avoid shadowing.

2018-10-28 Thread Masahiro Yamada
On Wed, Oct 24, 2018 at 1:05 PM Leonardo Bras  wrote:
>
> Changes the parameter name to avoid shadowing a variable.
>
> Signed-off-by: Leonardo Bras 


For this one, I'd rather like to see code refactoring
than renaming the variable.

I will take a closer look.




> ---
>  scripts/mod/modpost.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> index 0d998c54564d..368fe42340df 100644
> --- a/scripts/mod/modpost.c
> +++ b/scripts/mod/modpost.c
> @@ -2228,13 +2228,13 @@ static int add_versions(struct buffer *b, struct 
> module *mod)
>  }
>
>  static void add_depends(struct buffer *b, struct module *mod,
> -   struct module *modules)
> +   struct module *module_list)
>  {
> struct symbol *s;
> struct module *m;
> int first = 1;
>
> -   for (m = modules; m; m = m->next)
> +   for (m = module_list; m; m = m->next)
> m->seen = is_vmlinux(m->name);
>
> buf_printf(b, "\n");
> --
> 2.19.1
>


-- 
Best Regards
Masahiro Yamada


[PATCH v3 4/5] modpost: Changes parameter name to avoid shadowing.

2018-10-23 Thread Leonardo Bras
Changes the parameter name to avoid shadowing a variable.

Signed-off-by: Leonardo Bras 
---
 scripts/mod/modpost.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 0d998c54564d..368fe42340df 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -2228,13 +2228,13 @@ static int add_versions(struct buffer *b, struct module 
*mod)
 }
 
 static void add_depends(struct buffer *b, struct module *mod,
-   struct module *modules)
+   struct module *module_list)
 {
struct symbol *s;
struct module *m;
int first = 1;
 
-   for (m = modules; m; m = m->next)
+   for (m = module_list; m; m = m->next)
m->seen = is_vmlinux(m->name);
 
buf_printf(b, "\n");
-- 
2.19.1



[PATCH v3 4/5] modpost: Changes parameter name to avoid shadowing.

2018-10-23 Thread Leonardo Bras
Changes the parameter name to avoid shadowing a variable.

Signed-off-by: Leonardo Bras 
---
 scripts/mod/modpost.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 0d998c54564d..368fe42340df 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -2228,13 +2228,13 @@ static int add_versions(struct buffer *b, struct module 
*mod)
 }
 
 static void add_depends(struct buffer *b, struct module *mod,
-   struct module *modules)
+   struct module *module_list)
 {
struct symbol *s;
struct module *m;
int first = 1;
 
-   for (m = modules; m; m = m->next)
+   for (m = module_list; m; m = m->next)
m->seen = is_vmlinux(m->name);
 
buf_printf(b, "\n");
-- 
2.19.1