Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp9126918rwl; Wed, 11 Jan 2023 01:38:10 -0800 (PST) X-Google-Smtp-Source: AMrXdXuDTl/gmWKx5AqRl5VzX1Lu4OTz4v5JkrJwWqLuB9Q9jZyJDPxPSVc/hWYZrAN6xWR9FzzB X-Received: by 2002:a05:6a21:1584:b0:b3:32fa:1d91 with SMTP id nr4-20020a056a21158400b000b332fa1d91mr63381572pzb.50.1673429889982; Wed, 11 Jan 2023 01:38:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673429889; cv=none; d=google.com; s=arc-20160816; b=B8yrwQ61d9jLhLZvEVrREKlZUcYGiE0p3ZihcWsPLqEsNp360+r2cFY0d2uz86KrUA LG2XIOV4HTfhdkT9yMroLOkDHXdYazWPNwxcI5n6jozB9ADY2OaZuKmQM20h3Luth2+D EG+FxhtEAaWJmt4dcG53oIfDN1HXoOJIfVUPMAiZjxM6HYpxlQXcWmYj3HLCBqJxVySa J6WCdzdFbv0kDKYZ9ujR81pV2VBsmB7TbjbaEs9c7EquimbST25SvCV32pivjYQ6r3KO ryphrm8Ubn0xywwC3ENmIP8C9a6Iyd1GoHmZKMO981MTQpCRz6N+K/QCJSTXl1oEFBv/ rRxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=nAgA2dbnKHwLex/ei6f2yYYQvAIZ6q4d/tj7nRTQ3AE=; b=sFQNrJJIcL4AYYefINw4alsYEimp9CQ55R064p6rJNu2IJIfv4TzRCefG8ihHYpRnX wutqkbn5acW/+GmDy+IoULqT2u54MjrVEbFGNdFOvP3s40e6m8JYQn8AQs2PMMgCHpAV 5MgTTLUntRI6Ix9l7TECN4kqlCaYvZzLyYjf2ldyUevvdM8TZjHLvotu1eXcr5jvI6SR P6gM8KgyeGgGe360r3RUOVCsiPCcIrkGvZiDGLjvt3fwfTdr025ZGNbIxdwYIZMycq86 bhL8wK4EiYCI53iYME83o1NACc2j+CH6psyX5kBOcxeNjYn8KByEbqcCSPHii5xJGt96 IICw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h189-20020a6383c6000000b004792a8f99fdsi13244056pge.742.2023.01.11.01.38.02; Wed, 11 Jan 2023 01:38:09 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238979AbjAKJ3N (ORCPT + 55 others); Wed, 11 Jan 2023 04:29:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232736AbjAKJ2H (ORCPT ); Wed, 11 Jan 2023 04:28:07 -0500 Received: from mail.nfschina.com (unknown [42.101.60.237]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F1B3B1ED for ; Wed, 11 Jan 2023 01:27:49 -0800 (PST) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id 204191A00A19; Wed, 11 Jan 2023 17:28:03 +0800 (CST) X-Virus-Scanned: amavisd-new at nfschina.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (localhost.localdomain [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DO63PvYobsTQ; Wed, 11 Jan 2023 17:28:02 +0800 (CST) Received: from kernel.localdomain (unknown [219.141.250.2]) (Authenticated sender: lvqian@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 1833F1A00818; Wed, 11 Jan 2023 17:28:02 +0800 (CST) From: lvqian@nfschina.com To: cl@linux.co, penberg@kernel.org, rientjes@google.com, kim@lge.com, akpm@linux-foundation.org, vbabka@suse.cz, roman.gushchin@linux.dev, 42.hyeyoo@gmail.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, lvqian Subject: [PATCH V2] mm/slab.c: Delete the if statement Date: Wed, 11 Jan 2023 17:27:44 +0800 Message-Id: <20230111092744.112038-1-lvqian@nfschina.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RDNS_NONE, SPF_HELO_NONE,SPF_NONE autolearn=no 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 From: lvqian Remove the if statement to increase code readability. Signed-off-by: lvqian --- v2: Modify the subject content --- mm/slab.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/mm/slab.c b/mm/slab.c index 7a269db050ee..713265fe2dea 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -1415,11 +1415,8 @@ static void kmem_rcu_free(struct rcu_head *head) #if DEBUG static bool is_debug_pagealloc_cache(struct kmem_cache *cachep) { - if (debug_pagealloc_enabled_static() && OFF_SLAB(cachep) && - (cachep->size % PAGE_SIZE) == 0) - return true; - - return false; + return debug_pagealloc_enabled_static() && OFF_SLAB(cachep) && + ((cachep->size % PAGE_SIZE) == 0); } #ifdef CONFIG_DEBUG_PAGEALLOC -- 2.34.1