mm/highmem: remove unnecessary done label
Subsystems (2)
PATCH 1/1 mm/highmem: remove unnecessary done label
Remove unnecessary done label to simplify the code.
Signed-off-by Miaohe Lin <[email protected]>
--- mm/highmem.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
mm/highmem.c +4 -5
@@ -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 ; }
Signature · 1 line
2.23.0
Quoted 4 lines · Miaohe Lin
Remove unnecessary done label to simplify the code.
Signed-off-by Miaohe Lin <[email protected]>
Reviewed-by Muchun Song <[email protected]>
Quoted 31 lines · Miaohe Lin
Remove unnecessary done label to simplify the code.
Signed-off-by Miaohe Lin <[email protected]>--- mm/highmem.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)mm/highmem.c +2
-4@@ -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;
mm/highmem.c void set_page_address(struct page *page, void *virtual) · line 784
Quoted 10 lines
mm/highmem.c +2
-1+break ; } }spin_unlock_irqrestore (&pas->lock, flags); } -done: +return ; }
Reviewed-by David Hildenbrand <[email protected]>
Signature · 3 lines
Thanks, David / dhildenb
Quoted 3 lines · Miaohe Lin
Remove unnecessary done label to simplify the code.
Signed-off-by Miaohe Lin <[email protected]>
Acked-by David Rientjes <[email protected]>