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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DD3BC4332F for ; Thu, 29 Dec 2022 07:54:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7A12B8E0002; Thu, 29 Dec 2022 02:54:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 750038E0001; Thu, 29 Dec 2022 02:54:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 617358E0002; Thu, 29 Dec 2022 02:54:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 5271D8E0001 for ; Thu, 29 Dec 2022 02:54:34 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 13146AB003 for ; Thu, 29 Dec 2022 07:54:34 +0000 (UTC) X-FDA: 80294581668.22.83B4619 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf26.hostedemail.com (Postfix) with ESMTP id 651AC140009 for ; Thu, 29 Dec 2022 07:54:31 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=gTVErcnG; spf=pass (imf26.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1672300472; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=QN4lRYdOBq98VsTNftJwMlcLq/DxQV6xqfwGwYL5iZ0=; b=jmL+9DGQTlkUOe1CWP3OzHOAYrnddNbndsMcsXM/lIdyZaCU9IWdm1+cDr40UTGVtWXx/3 hjqWPFfTA1CRK+gdJ+0boyF+cWljf0N5I05WheJeTETEpz7RUQWYtQW4yzOd8X+KjnybmV P+XypG12+53PU18NIpNFz7sGn2cjCJ8= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=gTVErcnG; spf=pass (imf26.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1672300472; a=rsa-sha256; cv=none; b=CqvuJIbX5UKT6dEMtnwQ8jZKPQ1acf7Cn/9GsCkFfzuAaHSHmgihtJKN3OJDlBX010OU6I zcT/9tzivrq6UtQ9OkzXQQHZVeeKriRHZajcmon0Eou3jM1mLXqYlY5oykMtFkec0uh1U+ 8yhhUC3VuIsOEUHkSgUdKVn4wMd4P2c= 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 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 651AC140009 X-Rspam-User: X-Stat-Signature: dirpxjbmss9dnu5smwbztmtwpkyyf1qp X-HE-Tag: 1672300471-473536 X-HE-Meta: U2FsdGVkX18JQ/lNeuORvLdjLVZFZLo/6x481aGdn4jbxaSmVIrQ31DbJbXywnCKfrLEXX7YNfBPXcwMVQmYKfEKRLMcExqkyUA3+0p3Rs8UZ2FOp5myius+Sy3uPwDsmRtvsRweDXkzy/iHRjg+xMRQPlteWFpo+xn3ifw/obZ410IsnkvSeTvLePXtRQNcfUJmO+Y2mqzOeq0F3sZ97URTTiYPXXsZolUhvs9/7IJvMFyzcUk0R3mPpB9/MmXdqvhhQ55fDtJh/M+0LvgPzJqLwYofb5/ZljWxoHsLgIeKh5j+r7aRUKn3mmm/ntByTbzG6vFWd1BQ99+ilX8WHj9bbJAw8t3RZ5ikGdf4Wh7gP07SnWWZJzky50FwqdLV8K+d2XzEjDClfK6Aztx4f9BPrnfCeKREWuQC7ZbrgdC8zUhSeDdhFzx4eRIjl4ygiWv7F570dHdZSIcmoW3/pl1AfyGshnAiRo8tbv9KHwrG2O/q/4EmuT0NOFInRAHK4yAbDf39hHTdjso4ziWVQhS0j6p6klqtg0shybhx6CJ878qS52Pzb2DFRktl7ZqHF06ThcjrOhd37efe0PjlWURsEhL4zCqbOluIF+fHrsmn7MzIpqogYzVAIde7iuGoog3wrAjZ4jNi2jUDp3Dz0eTIDup6NZSvouc4ZmtvUSkyJ5PI0Nrv2oDakxftLWDFa6yluqmTnZ7MTG/2bXdGr1RJPjC2ZKDOrQ2SrpAvbJYVq/2ux/i4sNPsk+t6wnIA9mwmbU1nzJRFR2JpdU3zuBMUd60e3+3Qyn3ft2zbsyVVnbrEObfCZ5RvbjpMSIHZLrIc+3xrwJgIRNyW9Z3g9wWfeBGpmc/w2Jox2WYTAch+JrsAojpdtsbPFyuPm2gc7xxh5e3o1BFq7p9yWoPf8FM2lg4aVD6HnanvNiSypSTj07Fbunduk5CcuogwKRznz26R+esW00mMCcq84a2 akw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 >