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: 13013419 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 02DA0C4332F for ; Thu, 20 Oct 2022 12:52:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 377158E0002; Thu, 20 Oct 2022 08:52:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3270F8E0001; Thu, 20 Oct 2022 08:52:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 217058E0002; Thu, 20 Oct 2022 08:52:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 12A178E0001 for ; Thu, 20 Oct 2022 08:52:55 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id C1BD0A0789 for ; Thu, 20 Oct 2022 12:52:54 +0000 (UTC) X-FDA: 80041317468.23.463FE47 Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by imf28.hostedemail.com (Postfix) with ESMTP id 4E46BC000A for ; Thu, 20 Oct 2022 12:52:53 +0000 (UTC) Received: by mail-ej1-f54.google.com with SMTP id a26so46777865ejc.4 for ; Thu, 20 Oct 2022 05:52:52 -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=Ll0rs9LTBfOdwSbw5OqvMD16bufdHRdzsbSiWu2IN9E7Lb1KLl8ZQllvNiZ18E0Md5 ipP0a9U55V03wfSY75zaFCtbiflqGKIEvi/3vLqjVJVaJ6mB3A5JEhDfOcSlrKoFitmf h3HpZQC5EV7d0sEVujUX6f+C+zPsPrEd6how9LrmMGrfxvpLaLe9T4GxGRKpLPPPij25 XgGqbv14AdOIgCcCZAC9HhvpHD3E1qjPNfevMc1SYV3vNWyFE+VaV9O/qWmN7aADCSQC D8YZQBxU9R0MMevAYCFCDoP5fAZ9jiOoAf6cdX16vwz5v0jpGgtwoGM3A9KsVXcfxPnx Nttw== X-Gm-Message-State: ACrzQf2ezKcnHKoUMm0hI3l2XVI0jfmtWXQit/bKnggZiJK2cW98u9zw KBtxuZgqgq8rO1T4c+BQ7NA= X-Google-Smtp-Source: AMsMyM5LlHFaCljG+RAp/54cLl1ecwNq+01Y4j296DN3CdV4vyLKNt/rAy/kauNoo+SfXPKCIyRO2A== 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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666270373; a=rsa-sha256; cv=none; b=YxYxkfaZ1V8j6gQGk00nEMHzRJHLAfEV1cdSMj+U59DRdCYyoU48Hy4hjIziwzlyTPjVWY G4WE8/vv+YtfxP5fnozqxR6Xe7SAoKk3Z0u8lBXQyEewN/LerehCzgu0mSusfh+3w0g0Jl M0XoA5XA6rIRxcsICbHMkxVc+hzt4NA= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=kAMuBLNS; spf=pass (imf28.hostedemail.com: domain of urezki@gmail.com designates 209.85.218.54 as permitted sender) smtp.mailfrom=urezki@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666270373; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=WK/n/LhkGr1JoySFzksopsOUgF3OVJuEP860WPQR98E=; b=nyodLmmCHkvTCGOtARxwafQagKBsWc5jEw1XVV2gWPDSnQi3+LPadqQALoEOmXdYjQcq+J UuQdxVECm0kELEN0moSqsRV9OMA++3W824dijOP1N7QyYJ14tFqzDi9OvS2knOU5jYxP1f Aw24iayQPJK4yzAFb0OZW8Q9n9GegWw= X-Stat-Signature: 9aam7iawqwen39qzxbkcftbi3f4s5k9n X-Rspamd-Queue-Id: 4E46BC000A X-Rspam-User: X-Rspamd-Server: rspam03 Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=kAMuBLNS; spf=pass (imf28.hostedemail.com: domain of urezki@gmail.com designates 209.85.218.54 as permitted sender) smtp.mailfrom=urezki@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-HE-Tag: 1666270373-241390 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: 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; } /*