lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHbLzkrqwOp0a_6Vzn29h9qwCiwVSLL6QzsMLfOYTWj7mtkNZg@mail.gmail.com>
Date:   Thu, 5 Aug 2021 12:54:19 -0700
From:   Yang Shi <shy828301@...il.com>
To:     Baolin Wang <baolin.wang@...ux.alibaba.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Linux MM <linux-mm@...ck.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 5/5] mm: migrate: Remove redundant goto labels

On Thu, Aug 5, 2021 at 8:06 AM Baolin Wang
<baolin.wang@...ux.alibaba.com> wrote:
>
> Remove redundant goto labels to simplify the code.

TBH I don't see too much benefit. The "goto" makes the functions have
a single exit point.

>
> Signed-off-by: Baolin Wang <baolin.wang@...ux.alibaba.com>
> ---
>  mm/migrate.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/mm/migrate.c b/mm/migrate.c
> index 0ab364f..ed74fda 100644
> --- a/mm/migrate.c
> +++ b/mm/migrate.c
> @@ -911,9 +911,8 @@ static int move_to_new_page(struct page *newpage, struct page *page,
>                  */
>                 VM_BUG_ON_PAGE(!PageIsolated(page), page);
>                 if (!PageMovable(page)) {
> -                       rc = MIGRATEPAGE_SUCCESS;
>                         __ClearPageIsolated(page);
> -                       goto out;
> +                       return MIGRATEPAGE_SUCCESS;
>                 }
>
>                 rc = mapping->a_ops->migratepage(mapping, newpage,
> @@ -949,7 +948,7 @@ static int move_to_new_page(struct page *newpage, struct page *page,
>                         flush_dcache_page(newpage);
>
>         }
> -out:
> +
>         return rc;
>  }
>
> @@ -2095,11 +2094,10 @@ static struct page *alloc_misplaced_dst_page_thp(struct page *page,
>         newpage = alloc_pages_node(nid, (GFP_TRANSHUGE_LIGHT | __GFP_THISNODE),
>                                    HPAGE_PMD_ORDER);
>         if (!newpage)
> -               goto out;
> +               return NULL;
>
>         prep_transhuge_page(newpage);
>
> -out:
>         return newpage;
>  }
>
> --
> 1.8.3.1
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ