From patchwork Thu Oct 20 12:52:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 6186 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp99062wrr; Thu, 20 Oct 2022 06:06:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4mbCu6OwfjVk/IteshG6pWjgzTUpmJBKyv3+VINPsjlzFlRR6GJ+1b1VeJT/uDJziCrDHQ X-Received: by 2002:a17:907:7f91:b0:78e:2e30:9513 with SMTP id qk17-20020a1709077f9100b0078e2e309513mr10776999ejc.759.1666271167026; Thu, 20 Oct 2022 06:06:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666271167; cv=none; d=google.com; s=arc-20160816; b=NSRT8xrbR2KD24qMEhH4V1sCBkht35DQR8zkzbq9pOdhB+xabZte2a6AgFYsVNg0zv sGEudj/qRbN0YcJh/az/S3v5bdw2BSck3DIjWaNy3J/QSl9H+mCXXgZeJ29iVqjV9qw6 3qPERcmFA/ALcB762h8GIc0nWHaV2sdjalVanGlksXWLZ0si9YFfV9Cx/9VnVlPXLPoU 5OcSjSoAevHMfzfrcnhclO1FSj1l7y1efoSlQgnczy2NY/7rUa3BmCk5ZdVDGjdEcUbt QCoVh+yMKIe7uO91lLgAUb9gVMIp5XlQ+ajAG+aMsYLeS3Nm55Bvf+JPMIMsSizLM6/u 1uYg== 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:dkim-signature; bh=WK/n/LhkGr1JoySFzksopsOUgF3OVJuEP860WPQR98E=; b=MyN60yewznuSrKHCD0HoGqsbV0lBN4AmWW2PuvLsBiqqWVg12KpE1xosKqjLfP2YTH CtIQniRqSazbRpue5amPprw7cSVgzOdcYJGT5nBhHF8KX2CP/bF3/bY68Dkc/gKEOsbU 3vjx8oE3hWuBrmHrUjfKF5CTfEuP/bPprm9fuNMvSarA7Xcw7W5LZo6scuhs7KSmHVE0 ix6brpocVu33oDK2j/T+492ABoU2LbkdHmu2Y8vBw73/xT+SXY/uvhDY2pStJu4vDTNE MrBbVRz+F0HOX+JmISWIHmEQK6VcF0YRU8gVHgsGPfX3gnJTO5F3NycoCjM5C3SQ5Uxd 6n0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kAMuBLNS; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y10-20020a50eb0a000000b00458ab54baa5si14724837edp.503.2022.10.20.06.04.39; Thu, 20 Oct 2022 06:06:07 -0700 (PDT) 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=@gmail.com header.s=20210112 header.b=kAMuBLNS; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230224AbiJTMw4 (ORCPT + 99 others); Thu, 20 Oct 2022 08:52:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229755AbiJTMwy (ORCPT ); Thu, 20 Oct 2022 08:52:54 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FD3617F288 for ; Thu, 20 Oct 2022 05:52:53 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id d26so47138543ejc.8 for ; Thu, 20 Oct 2022 05:52:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=WK/n/LhkGr1JoySFzksopsOUgF3OVJuEP860WPQR98E=; b=kAMuBLNSHzFOG1rV1RUFKfDOOX5Ru/a9QO5AhLydiQs8qIxh0zsEaGi9QAGiazj4Ri hi0Sr10ni0diYSRpKVxkYOBIbU7en+cwv1Ay01iXWJF2duMc5wQrwUCqAOrxotEUBe7u o0VD4iU+y+qsJ25Z8mCtmsWX5Bh1oXIsdJl7tnfppDRdZGfktVLEuUfc1FozFOeFDEJD MDzsfwBuC9XDa2OEbQAKVaKGNZMScjEsuy81Ok5EvdUWvudLb1lgopiiNY/3dAxVZhfG /CR0D9Vk5iBQvtgHwBHZEHqeb32RUw7ZslsXOIJZ+JDrulV53Wadap2idbrF3zqQS/sb Fnow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WK/n/LhkGr1JoySFzksopsOUgF3OVJuEP860WPQR98E=; b=wswxNXOpA2eGjd9RgCCxoqQh3jjvZmPqLf3AgwQLbr72p/S0kJ23lTk88Db1Jd4wSt H3uIh68+ljU14Qu3JfiiMlyNkxbHSxZTDY6mjQ66PSZ5il1CWD/0kUCvqGQP6LWoT357 2wXcpY3evwI/DrdO5dABGRq5LWmzgfQvY+/ZVrRVGul2y9KlQX2OYSZpudZl7aff6pOj JV7dgpuE58AsIEF5NEZ7v91PNm+htr+Lwlxx2mul5otD2dFdiVYN6VJ/JREMWR/oz5ri 7YIP/ZmrPHZJUklleLSw0qGj/6WyxPxpPaYWojwiGR/RfnNcL5ZfVw2YBYbwYPvMfeRf KFCg== X-Gm-Message-State: ACrzQf0jftqgHL1uFViXsXxsKsToq9AoDhWcUOU6xRzRnA26S8F/3UY4 rXU3N4rTS8zC65krVJWPBko= X-Received: by 2002:a17:907:80d:b0:73d:a576:dfbd with SMTP id wv13-20020a170907080d00b0073da576dfbdmr10866596ejb.402.1666270371786; Thu, 20 Oct 2022 05:52:51 -0700 (PDT) Received: from pc638.lan ([155.137.26.201]) by smtp.gmail.com with ESMTPSA id cs2-20020a0564020c4200b004585eba4baesm12107456edb.80.2022.10.20.05.52.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 05:52:50 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: Andrew Morton Cc: linux-mm@kvack.org, LKML , Christoph Hellwig , Matthew Wilcox , Nicholas Piggin , Uladzislau Rezki , Oleksiy Avramchenko Subject: [PATCH 1/1] mm: vmalloc: Simplify return boolean expression Date: Thu, 20 Oct 2022 14:52:47 +0200 Message-Id: <20221020125247.5053-1-urezki@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747211955425675422?= X-GMAIL-MSGID: =?utf-8?q?1747211955425675422?= A return expression of the __purge_vmap_area_lazy() function can be simplified. Basically a boolean expression anyway is converted to boolean values either to true or false. Suggested-by: Christoph Hellwig Signed-off-by: Uladzislau Rezki (Sony) --- mm/vmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index bd56f68bedf0..0685b477c71b 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -1787,7 +1787,7 @@ static bool __purge_vmap_area_lazy(unsigned long start, unsigned long end) out: trace_purge_vmap_area_lazy(start, end, num_purged_areas); - return num_purged_areas > 0 ? true:false; + return num_purged_areas > 0; } /*