All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] init: remove unused names parameter of split_fs_names()
@ 2022-02-15  7:06 Jeffle Xu
  2022-02-15  7:12 ` Christoph Hellwig
  2022-02-15 19:23 ` Vivek Goyal
  0 siblings, 2 replies; 5+ messages in thread
From: Jeffle Xu @ 2022-02-15  7:06 UTC (permalink / raw)
  To: viro, linux-fsdevel; +Cc: vgoyal, hch

It is a trivial cleanup.

Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
---
 init/do_mounts.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/init/do_mounts.c b/init/do_mounts.c
index 762b534978d9..15502d4ef249 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -339,7 +339,7 @@ __setup("rootfstype=", fs_names_setup);
 __setup("rootdelay=", root_delay_setup);
 
 /* This can return zero length strings. Caller should check */
-static int __init split_fs_names(char *page, size_t size, char *names)
+static int __init split_fs_names(char *page, size_t size)
 {
 	int count = 1;
 	char *p = page;
@@ -403,7 +403,7 @@ void __init mount_block_root(char *name, int flags)
 	scnprintf(b, BDEVNAME_SIZE, "unknown-block(%u,%u)",
 		  MAJOR(ROOT_DEV), MINOR(ROOT_DEV));
 	if (root_fs_names)
-		num_fs = split_fs_names(fs_names, PAGE_SIZE, root_fs_names);
+		num_fs = split_fs_names(fs_names, PAGE_SIZE);
 	else
 		num_fs = list_bdev_fs_names(fs_names, PAGE_SIZE);
 retry:
@@ -546,7 +546,7 @@ static int __init mount_nodev_root(void)
 	fs_names = (void *)__get_free_page(GFP_KERNEL);
 	if (!fs_names)
 		return -EINVAL;
-	num_fs = split_fs_names(fs_names, PAGE_SIZE, root_fs_names);
+	num_fs = split_fs_names(fs_names, PAGE_SIZE);
 
 	for (i = 0, fstype = fs_names; i < num_fs;
 	     i++, fstype += strlen(fstype) + 1) {
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] init: remove unused names parameter of split_fs_names()
  2022-02-15  7:06 [PATCH] init: remove unused names parameter of split_fs_names() Jeffle Xu
@ 2022-02-15  7:12 ` Christoph Hellwig
  2022-02-15 19:23 ` Vivek Goyal
  1 sibling, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2022-02-15  7:12 UTC (permalink / raw)
  To: Jeffle Xu; +Cc: viro, linux-fsdevel, vgoyal, hch

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] init: remove unused names parameter of split_fs_names()
  2022-02-15  7:06 [PATCH] init: remove unused names parameter of split_fs_names() Jeffle Xu
  2022-02-15  7:12 ` Christoph Hellwig
@ 2022-02-15 19:23 ` Vivek Goyal
  2022-02-16  1:32   ` JeffleXu
  1 sibling, 1 reply; 5+ messages in thread
From: Vivek Goyal @ 2022-02-15 19:23 UTC (permalink / raw)
  To: Jeffle Xu; +Cc: viro, linux-fsdevel, hch

On Tue, Feb 15, 2022 at 03:06:10PM +0800, Jeffle Xu wrote:
> It is a trivial cleanup.
> 

Would it be better to modify split_fs_names() instead and use
parameter "names" insted of directly using "root_fs_names".

Vivek

> Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
> ---
>  init/do_mounts.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/init/do_mounts.c b/init/do_mounts.c
> index 762b534978d9..15502d4ef249 100644
> --- a/init/do_mounts.c
> +++ b/init/do_mounts.c
> @@ -339,7 +339,7 @@ __setup("rootfstype=", fs_names_setup);
>  __setup("rootdelay=", root_delay_setup);
>  
>  /* This can return zero length strings. Caller should check */
> -static int __init split_fs_names(char *page, size_t size, char *names)
> +static int __init split_fs_names(char *page, size_t size)
>  {
>  	int count = 1;
>  	char *p = page;
> @@ -403,7 +403,7 @@ void __init mount_block_root(char *name, int flags)
>  	scnprintf(b, BDEVNAME_SIZE, "unknown-block(%u,%u)",
>  		  MAJOR(ROOT_DEV), MINOR(ROOT_DEV));
>  	if (root_fs_names)
> -		num_fs = split_fs_names(fs_names, PAGE_SIZE, root_fs_names);
> +		num_fs = split_fs_names(fs_names, PAGE_SIZE);
>  	else
>  		num_fs = list_bdev_fs_names(fs_names, PAGE_SIZE);
>  retry:
> @@ -546,7 +546,7 @@ static int __init mount_nodev_root(void)
>  	fs_names = (void *)__get_free_page(GFP_KERNEL);
>  	if (!fs_names)
>  		return -EINVAL;
> -	num_fs = split_fs_names(fs_names, PAGE_SIZE, root_fs_names);
> +	num_fs = split_fs_names(fs_names, PAGE_SIZE);
>  
>  	for (i = 0, fstype = fs_names; i < num_fs;
>  	     i++, fstype += strlen(fstype) + 1) {
> -- 
> 2.27.0
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] init: remove unused names parameter of split_fs_names()
  2022-02-15 19:23 ` Vivek Goyal
@ 2022-02-16  1:32   ` JeffleXu
  2022-02-16 15:36     ` Vivek Goyal
  0 siblings, 1 reply; 5+ messages in thread
From: JeffleXu @ 2022-02-16  1:32 UTC (permalink / raw)
  To: Vivek Goyal; +Cc: viro, linux-fsdevel, hch



On 2/16/22 3:23 AM, Vivek Goyal wrote:
> On Tue, Feb 15, 2022 at 03:06:10PM +0800, Jeffle Xu wrote:
>> It is a trivial cleanup.
>>
> 
> Would it be better to modify split_fs_names() instead and use
> parameter "names" insted of directly using "root_fs_names".

Yes it can do. But currently split_fs_names() is only called by
mount_block_root() and mount_nodev_root(), in which names argument is
always root_fs_names. And split_fs_names() is declared as a static
function in init/do_mounts.c.

> 
>> Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
>> ---
>>  init/do_mounts.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/init/do_mounts.c b/init/do_mounts.c
>> index 762b534978d9..15502d4ef249 100644
>> --- a/init/do_mounts.c
>> +++ b/init/do_mounts.c
>> @@ -339,7 +339,7 @@ __setup("rootfstype=", fs_names_setup);
>>  __setup("rootdelay=", root_delay_setup);
>>  
>>  /* This can return zero length strings. Caller should check */
>> -static int __init split_fs_names(char *page, size_t size, char *names)
>> +static int __init split_fs_names(char *page, size_t size)
>>  {
>>  	int count = 1;
>>  	char *p = page;
>> @@ -403,7 +403,7 @@ void __init mount_block_root(char *name, int flags)
>>  	scnprintf(b, BDEVNAME_SIZE, "unknown-block(%u,%u)",
>>  		  MAJOR(ROOT_DEV), MINOR(ROOT_DEV));
>>  	if (root_fs_names)
>> -		num_fs = split_fs_names(fs_names, PAGE_SIZE, root_fs_names);
>> +		num_fs = split_fs_names(fs_names, PAGE_SIZE);
>>  	else
>>  		num_fs = list_bdev_fs_names(fs_names, PAGE_SIZE);
>>  retry:
>> @@ -546,7 +546,7 @@ static int __init mount_nodev_root(void)
>>  	fs_names = (void *)__get_free_page(GFP_KERNEL);
>>  	if (!fs_names)
>>  		return -EINVAL;
>> -	num_fs = split_fs_names(fs_names, PAGE_SIZE, root_fs_names);
>> +	num_fs = split_fs_names(fs_names, PAGE_SIZE);
>>  
>>  	for (i = 0, fstype = fs_names; i < num_fs;
>>  	     i++, fstype += strlen(fstype) + 1) {
>> -- 
>> 2.27.0
>>

-- 
Thanks,
Jeffle

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] init: remove unused names parameter of split_fs_names()
  2022-02-16  1:32   ` JeffleXu
@ 2022-02-16 15:36     ` Vivek Goyal
  0 siblings, 0 replies; 5+ messages in thread
From: Vivek Goyal @ 2022-02-16 15:36 UTC (permalink / raw)
  To: JeffleXu; +Cc: viro, linux-fsdevel, hch

On Wed, Feb 16, 2022 at 09:32:33AM +0800, JeffleXu wrote:
> 
> 
> On 2/16/22 3:23 AM, Vivek Goyal wrote:
> > On Tue, Feb 15, 2022 at 03:06:10PM +0800, Jeffle Xu wrote:
> >> It is a trivial cleanup.
> >>
> > 
> > Would it be better to modify split_fs_names() instead and use
> > parameter "names" insted of directly using "root_fs_names".
> 
> Yes it can do. But currently split_fs_names() is only called by
> mount_block_root() and mount_nodev_root(), in which names argument is
> always root_fs_names. And split_fs_names() is declared as a static
> function in init/do_mounts.c.

Ok, fair enough. I am fine with this patch. I am not very particular
about using a parameter. Was just trying to avoid making use of
"root_fs_names" directly in functions because it makes it harder
to read the code. Anyway, not a big deal.

Reviewed-by: Vivek Goyal <vgoyal@redhat.com>

Vivek
> 
> > 
> >> Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
> >> ---
> >>  init/do_mounts.c | 6 +++---
> >>  1 file changed, 3 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/init/do_mounts.c b/init/do_mounts.c
> >> index 762b534978d9..15502d4ef249 100644
> >> --- a/init/do_mounts.c
> >> +++ b/init/do_mounts.c
> >> @@ -339,7 +339,7 @@ __setup("rootfstype=", fs_names_setup);
> >>  __setup("rootdelay=", root_delay_setup);
> >>  
> >>  /* This can return zero length strings. Caller should check */
> >> -static int __init split_fs_names(char *page, size_t size, char *names)
> >> +static int __init split_fs_names(char *page, size_t size)
> >>  {
> >>  	int count = 1;
> >>  	char *p = page;
> >> @@ -403,7 +403,7 @@ void __init mount_block_root(char *name, int flags)
> >>  	scnprintf(b, BDEVNAME_SIZE, "unknown-block(%u,%u)",
> >>  		  MAJOR(ROOT_DEV), MINOR(ROOT_DEV));
> >>  	if (root_fs_names)
> >> -		num_fs = split_fs_names(fs_names, PAGE_SIZE, root_fs_names);
> >> +		num_fs = split_fs_names(fs_names, PAGE_SIZE);
> >>  	else
> >>  		num_fs = list_bdev_fs_names(fs_names, PAGE_SIZE);
> >>  retry:
> >> @@ -546,7 +546,7 @@ static int __init mount_nodev_root(void)
> >>  	fs_names = (void *)__get_free_page(GFP_KERNEL);
> >>  	if (!fs_names)
> >>  		return -EINVAL;
> >> -	num_fs = split_fs_names(fs_names, PAGE_SIZE, root_fs_names);
> >> +	num_fs = split_fs_names(fs_names, PAGE_SIZE);
> >>  
> >>  	for (i = 0, fstype = fs_names; i < num_fs;
> >>  	     i++, fstype += strlen(fstype) + 1) {
> >> -- 
> >> 2.27.0
> >>
> 
> -- 
> Thanks,
> Jeffle
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-02-16 15:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-15  7:06 [PATCH] init: remove unused names parameter of split_fs_names() Jeffle Xu
2022-02-15  7:12 ` Christoph Hellwig
2022-02-15 19:23 ` Vivek Goyal
2022-02-16  1:32   ` JeffleXu
2022-02-16 15:36     ` Vivek Goyal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.