Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp5644281rwl; Thu, 29 Dec 2022 00:05:20 -0800 (PST) X-Google-Smtp-Source: AMrXdXu9FjOb81KCX10YD6E1F3/552MuIz4cHFnRYH6dtdJT7PKdQ/ATMB/mp1f68lxkJjUbn5qA X-Received: by 2002:a17:90a:8915:b0:223:ec2c:f40 with SMTP id u21-20020a17090a891500b00223ec2c0f40mr31064038pjn.30.1672301120351; Thu, 29 Dec 2022 00:05:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672301120; cv=none; d=google.com; s=arc-20160816; b=RSOcmSeXzevmNi7fSIWVeYgtSr/wIodZDr9TjUoY55huAW2d0Pnqm7cLOIccQJBVJ/ yTLwIg+bwVw1hmyY/nfy06MJ7WSh0VlDMJe/OKXoq6zwhBeOFcfnVnU/nZGoG0oFF6bV RtwUwW/8nfBFyAskD4DAAzjq8c/ZYlVu9lPD4zh4sHSeTgks3UIRE0mz6pqNIq1Y2T4x LT8GORCG4pvQS1lAZ+A5KY7ILPCBUeBWVWT3JKCHvhqXOxXA3MkpVMcxPWufEaJ9RwSf 5bWCmCfwHC1Uwe+al87gNNY3aLowEZd/aTyZm6xguG2/O3H2STjcSeKE8vYlZk6GDFsT 79pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=QN4lRYdOBq98VsTNftJwMlcLq/DxQV6xqfwGwYL5iZ0=; b=NhpvySvo//CvP8odWH7w8q1t1TNusNj/gJleb9PxN/lleBIyDLvXMwEhfiPkwr1WRJ KUTzZENMhIC5ZnsErqRb0Q/ZwuOGxi9Uv8hKeKoR/kR3m6dwJv65Ta5swooRdA5VdKc2 vFeN/TZTxEtp1In8+xJ9lFQJurr1bJGwxu6P/xMe/dyPyfNlFOT+twG3nFK5hToZOaUu ht3oMFCiD6faS4I3W4wB/Aw1EXT1m9hGJEl2TQ1NRUo564WoAHAFI4ux35ltr6udcxVX dw9Y0KEtymUqzyP/fGPcpFbfsj9CrsCDuVdH0oDHD4tghyQT0TjBnA4KEai8Rexddorr g0Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gTVErcnG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p21-20020a631e55000000b004791c673bcesi18392904pgm.682.2022.12.29.00.05.07; Thu, 29 Dec 2022 00:05:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gTVErcnG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233080AbiL2Hzi (ORCPT + 62 others); 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 >