From patchwork Mon Jun 6 08:39:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 12870121 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 93361C43334 for ; Mon, 6 Jun 2022 08:39:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 31C2F8D0006; Mon, 6 Jun 2022 04:39:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2CBE88D0002; Mon, 6 Jun 2022 04:39:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1B9518D0006; Mon, 6 Jun 2022 04:39:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 0EA1D8D0002 for ; Mon, 6 Jun 2022 04:39:42 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id D9A2F206EE for ; Mon, 6 Jun 2022 08:39:41 +0000 (UTC) X-FDA: 79547162562.19.724C673 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf27.hostedemail.com (Postfix) with ESMTP id 09FE940022 for ; Mon, 6 Jun 2022 08:39:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654504780; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+MgDILZKDJLFM9v8vOajOt74G/rtOqju5l9xz3EQGok=; b=Ou5K0nqednGoAdfyfjzWX7YuGRc7ggCuwa2/g77oQiI80o6DH55+RzK/eEqIpBzz+0bfJY xcmKwdoOgQTdiz/NqfNXtIXd9bgET4loSj7mj2cbdncweBjf2OjRe7uib7ExQcpSk90VWo dZqxBgyOkMqOaQttsbZ7dbCN5Du3Aw8= 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-3-c-oMQXzkOoSCQb1I3mozTw-1; Mon, 06 Jun 2022 04:39:29 -0400 X-MC-Unique: c-oMQXzkOoSCQb1I3mozTw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4315085A5BC; Mon, 6 Jun 2022 08:39:29 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-14-4.pek2.redhat.com [10.72.14.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2B68A1121314; Mon, 6 Jun 2022 08:39:25 +0000 (UTC) From: Baoquan He To: akpm@linux-foundation.org Cc: npiggin@gmail.com, urezki@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Baoquan He Subject: [PATCH 1/5] mm/vmalloc: remove the unnecessary type check Date: Mon, 6 Jun 2022 16:39:05 +0800 Message-Id: <20220606083909.363350-2-bhe@redhat.com> In-Reply-To: <20220606083909.363350-1-bhe@redhat.com> References: <20220606083909.363350-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Stat-Signature: 6sq1bqkozr7ipjypt6adn5npxgittksq X-Rspam-User: Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Ou5K0nqe; spf=none (imf27.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 09FE940022 X-HE-Tag: 1654504776-131242 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: In function adjust_va_to_fit_type(), it checks all values of passed in fit type, including NOTHING_FIT in the else branch. In fact, it's unnecessary to check NOTHING_FIT since the check has been done before adjust_va_to_fit_type() is called in all call sites. So clean it up. Signed-off-by: Baoquan He --- mm/vmalloc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 07db42455dd4..b7a138ab7b79 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -1418,8 +1418,6 @@ adjust_va_to_fit_type(struct vmap_area *va, * Shrink this VA to remaining size. */ va->va_start = nva_start_addr + size; - } else { - return -1; } if (type != FL_FIT_TYPE) {