From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0230C4332F for ; Thu, 29 Dec 2022 07:55:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233082AbiL2Hzi (ORCPT ); Thu, 29 Dec 2022 02:55:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233097AbiL2HzS (ORCPT ); Thu, 29 Dec 2022 02:55:18 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49DDBF58F for ; Wed, 28 Dec 2022 23:54:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672300470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QN4lRYdOBq98VsTNftJwMlcLq/DxQV6xqfwGwYL5iZ0=; b=gTVErcnGunw1sW+DFdTh2wx5JfAmMItLQUR9Tmlabw1mn2aG7E/o8tbsyskdBXs8EOTeB/ ddQmB5hysvXW9LUrVmIg3z+rRJSrOI3cJOwi9z0dSUi9+em91UxJgVqBWAj0/2fcpbECfL P5uYxOFNP9o4au7o7QKxDPASsKsuUpc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-361-z4IPGljKOei_SFFomHipjw-1; Thu, 29 Dec 2022 02:54:27 -0500 X-MC-Unique: z4IPGljKOei_SFFomHipjw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2583885C069; Thu, 29 Dec 2022 07:54:27 +0000 (UTC) Received: from localhost (ovpn-12-77.pek2.redhat.com [10.72.12.77]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 661AC2026D4B; Thu, 29 Dec 2022 07:54:26 +0000 (UTC) Date: Thu, 29 Dec 2022 15:54:22 +0800 From: Baoquan He 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 Message-ID: References: <20221229071730.174444-1-lvqian@nfschina.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221229071730.174444-1-lvqian@nfschina.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/29/22 at 03:17pm, lvqian@nfschina.com wrote: > From: lvqian > > 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 > --- > 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 >