From patchwork Tue Mar 22 21:48:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12789271 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 DDC05C433F5 for ; Tue, 22 Mar 2022 21:48:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 757226B019A; Tue, 22 Mar 2022 17:48:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 72E206B019B; Tue, 22 Mar 2022 17:48:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 61D886B019C; Tue, 22 Mar 2022 17:48:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0218.hostedemail.com [216.40.44.218]) by kanga.kvack.org (Postfix) with ESMTP id 4FE4C6B019A for ; Tue, 22 Mar 2022 17:48:05 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id F140318289DE1 for ; Tue, 22 Mar 2022 21:48:04 +0000 (UTC) X-FDA: 79273360530.20.6BF1353 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf31.hostedemail.com (Postfix) with ESMTP id 5B1BB2001F for ; Tue, 22 Mar 2022 21:48:04 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 45A2BB81DAB; Tue, 22 Mar 2022 21:48:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EBCC0C340EC; Tue, 22 Mar 2022 21:48:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1647985682; bh=/zLP9MOXMJ3xicO3J2mxQjO4RL4KSCc6UFcpTeEo2EU=; h=Date:To:From:In-Reply-To:Subject:From; b=DwjDMB/MusslyG1lX0xvXbA9bEq3/LkMVFSSqg0bgfQWq4pZFVE4rh1ZHAiBxSIDc syPAlwZ1wcs2aNPen3qPge4MNfMeTOy/efcwb2fpOqoX216u/aSdLtqewdX0ZBJVZg wUJqWK+KrQjSvNoF298hEzlkuh3u0qnWZ5IAj5pA= Date: Tue, 22 Mar 2022 14:48:01 -0700 To: songmuchun@bytedance.com,rientjes@google.com,david@redhat.com,linmiaohe@huawei.com,akpm@linux-foundation.org,patches@lists.linux.dev,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220322143803.04a5e59a07e48284f196a2f9@linux-foundation.org> Subject: [patch 187/227] mm/highmem: remove unnecessary done label Message-Id: <20220322214801.EBCC0C340EC@smtp.kernel.org> X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: 39xcsdbw3hyfeyjc6a1eb4in3fopcfrz Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b="DwjDMB/M"; dmarc=none; spf=pass (imf31.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspamd-Queue-Id: 5B1BB2001F X-HE-Tag: 1647985684-598820 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: From: Miaohe Lin Subject: mm/highmem: remove unnecessary done label Remove unnecessary done label to simplify the code. Link: https://lkml.kernel.org/r/20220126092542.64659-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Muchun Song Reviewed-by: David Hildenbrand Acked-by: David Rientjes Signed-off-by: Andrew Morton --- mm/highmem.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) --- a/mm/highmem.c~mm-highmem-remove-unnecessary-done-label +++ a/mm/highmem.c @@ -736,11 +736,11 @@ void *page_address(const struct page *pa list_for_each_entry(pam, &pas->lh, list) { if (pam->page == page) { ret = pam->virtual; - goto done; + break; } } } -done: + spin_unlock_irqrestore(&pas->lock, flags); return ret; } @@ -773,13 +773,12 @@ void set_page_address(struct page *page, list_for_each_entry(pam, &pas->lh, list) { if (pam->page == page) { list_del(&pam->list); - spin_unlock_irqrestore(&pas->lock, flags); - goto done; + break; } } spin_unlock_irqrestore(&pas->lock, flags); } -done: + return; }