All of lore.kernel.org
 help / color / mirror / Atom feed
From: Baoquan He <bhe@redhat.com>
To: lvqian@nfschina.com
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/page_alloc.c: Remove function return value
Date: Thu, 29 Dec 2022 15:54:22 +0800	[thread overview]
Message-ID: <Y61Hrl43nmg8eclK@MiWiFi-R3L-srv> (raw)
In-Reply-To: <20221229071730.174444-1-lvqian@nfschina.com>

On 12/29/22 at 03:17pm, lvqian@nfschina.com wrote:
> From: lvqian <lvqian@nfschina.com>
> 
> The return value of this function has no meaning,
> so the original int type is replaced with a void type,
> which reduces the execution time of one return.
> 
> Signed-off-by: lvqian <lvqian@nfschina.com>
> ---
>  mm/page_alloc.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 0745aedebb37..fffe16d854a9 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -828,17 +828,16 @@ static int __init early_debug_pagealloc(char *buf)
>  }
>  early_param("debug_pagealloc", early_debug_pagealloc);
>  
> -static int __init debug_guardpage_minorder_setup(char *buf)
> +static void __init debug_guardpage_minorder_setup(char *buf)
>  {
>  	unsigned long res;
>  
>  	if (kstrtoul(buf, 10, &res) < 0 ||  res > MAX_ORDER / 2) {
>  		pr_err("Bad debug_guardpage_minorder value\n");
> -		return 0;

This could be not right. Please see parse_args(), the returned value is
needed, otherwise you might get stuff you don't want in the switch case
handling.

parse_early_param()
  -->parse_early_options()
     -->parse_args()

> +	} else {
> +		_debug_guardpage_minorder = res;
> +		pr_info("Setting debug_guardpage_minorder to %lu\n", res);
>  	}
> -	_debug_guardpage_minorder = res;
> -	pr_info("Setting debug_guardpage_minorder to %lu\n", res);
> -	return 0;
>  }
>  early_param("debug_guardpage_minorder", debug_guardpage_minorder_setup);
>  
> -- 
> 2.34.1
> 



  reply	other threads:[~2022-12-29  7:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-29  7:17 [PATCH] mm/page_alloc.c: Remove function return value lvqian
2022-12-29  7:54 ` Baoquan He [this message]
2022-12-29 11:53 ` kernel test robot
2022-12-29 12:34 ` kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2022-12-29  7:13 lvqian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y61Hrl43nmg8eclK@MiWiFi-R3L-srv \
    --to=bhe@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lvqian@nfschina.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.