[CRIU] [PATCH 5/7] files-reg: Remove redundant inner if

Dmitry Safonov 0x7f454c46 at gmail.com
Mon Apr 29 17:52:42 MSK 2019


On Sun, 28 Apr 2019 at 19:45, Rikard Falkeborn
<rikard.falkeborn at gmail.com> wrote:
>
> Remove a redundant if-statement, since the same condition is already
> checked in the outer if-statement.
>
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn at gmail.com>

Reviewed-by: Dmitry Safonov <0x7f454c46 at gmail.com>

> ---
>  criu/files-reg.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/criu/files-reg.c b/criu/files-reg.c
> index b30da8c9..b7e04384 100644
> --- a/criu/files-reg.c
> +++ b/criu/files-reg.c
> @@ -1745,12 +1745,10 @@ ext:
>                 }
>
>                 if (rfi->rfe->has_mode && (st.st_mode != rfi->rfe->mode)) {
> -                       if (st.st_mode != rfi->rfe->mode) {
> -                               pr_err("File %s has bad mode 0%o (expect 0%o)\n",
> -                                      rfi->path, (int)st.st_mode,
> -                                      rfi->rfe->mode);
> -                               return -1;
> -                       }
> +                       pr_err("File %s has bad mode 0%o (expect 0%o)\n",
> +                              rfi->path, (int)st.st_mode,
> +                              rfi->rfe->mode);
> +                       return -1;
>                 }
>
>                 /*
> --
> 2.21.0
>
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu



-- 
             Dmitry


More information about the CRIU mailing list