* [PATCH] mm/highmem: remove unnecessary done label
@ 2022-01-26 9:25 Miaohe Lin
2022-01-26 9:59 ` Muchun Song
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Miaohe Lin @ 2022-01-26 9:25 UTC (permalink / raw)
To: akpm; +Cc: linux-mm, linux-kernel, linmiaohe
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;
}
--
2.23.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mm/highmem: remove unnecessary done label
2022-01-26 9:25 [PATCH] mm/highmem: remove unnecessary done label Miaohe Lin
@ 2022-01-26 9:59 ` Muchun Song
2022-01-26 10:21 ` David Hildenbrand
2022-01-26 18:59 ` David Rientjes
2 siblings, 0 replies; 4+ messages in thread
From: Muchun Song @ 2022-01-26 9:59 UTC (permalink / raw)
To: Miaohe Lin; +Cc: Andrew Morton, Linux Memory Management List, LKML
On Wed, Jan 26, 2022 at 5:26 PM Miaohe Lin <linmiaohe@huawei.com> wrote:
>
> Remove unnecessary done label to simplify the code.
>
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mm/highmem: remove unnecessary done label
2022-01-26 9:25 [PATCH] mm/highmem: remove unnecessary done label Miaohe Lin
2022-01-26 9:59 ` Muchun Song
@ 2022-01-26 10:21 ` David Hildenbrand
2022-01-26 18:59 ` David Rientjes
2 siblings, 0 replies; 4+ messages in thread
From: David Hildenbrand @ 2022-01-26 10:21 UTC (permalink / raw)
To: Miaohe Lin, akpm; +Cc: linux-mm, linux-kernel
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mm/highmem: remove unnecessary done label
2022-01-26 9:25 [PATCH] mm/highmem: remove unnecessary done label Miaohe Lin
2022-01-26 9:59 ` Muchun Song
2022-01-26 10:21 ` David Hildenbrand
@ 2022-01-26 18:59 ` David Rientjes
2 siblings, 0 replies; 4+ messages in thread
From: David Rientjes @ 2022-01-26 18:59 UTC (permalink / raw)
To: Miaohe Lin; +Cc: akpm, linux-mm, linux-kernel
On Wed, 26 Jan 2022, Miaohe Lin wrote:
> Remove unnecessary done label to simplify the code.
>
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Acked-by: David Rientjes <rientjes@google.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-01-26 18:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-26 9:25 [PATCH] mm/highmem: remove unnecessary done label Miaohe Lin
2022-01-26 9:59 ` Muchun Song
2022-01-26 10:21 ` David Hildenbrand
2022-01-26 18:59 ` David Rientjes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).