linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Miaohe Lin <linmiaohe@huawei.com>, akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/highmem: remove unnecessary done label
Date: Wed, 26 Jan 2022 11:21:27 +0100	[thread overview]
Message-ID: <4b1bf433-067b-ebfb-4603-2e31e1990f77@redhat.com> (raw)
In-Reply-To: <20220126092542.64659-1-linmiaohe@huawei.com>

On 26.01.22 10:25, Miaohe Lin wrote:
> Remove unnecessary done label to simplify the code.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
>  mm/highmem.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/mm/highmem.c b/mm/highmem.c
> index 762679050c9a..0cc0c4da7ed9 100644
> --- a/mm/highmem.c
> +++ b/mm/highmem.c
> @@ -736,11 +736,11 @@ void *page_address(const struct page *page)
>  		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, void *virtual)
>  		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;
>  }
>  

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb



  parent reply	other threads:[~2022-01-26 10:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-26  9:25 Miaohe Lin
2022-01-26  9:59 ` Muchun Song
2022-01-26 10:21 ` David Hildenbrand [this message]
2022-01-26 18:59 ` David Rientjes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4b1bf433-067b-ebfb-4603-2e31e1990f77@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=linmiaohe@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox