[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cf07a880-1429-cc75-657e-55b32841cc00@huawei.com>
Date: Wed, 30 Oct 2024 12:45:42 +0800
From: Zhihao Cheng <chengzhihao1@...wei.com>
To: Colin Ian King <colin.i.king@...il.com>, David Woodhouse
<dwmw2@...radead.org>, Richard Weinberger <richard@....at>,
<linux-mtd@...ts.infradead.org>
CC: <kernel-janitors@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] jffs2: remove redundant check on outpos > pos
在 2024/10/30 6:20, Colin Ian King 写道:
> The check for outpos > pos is always false because outpos is zero
> and pos is at least zero; outpos can never be greater than pos.
> The check is redundant and can be removed.
>
> Signed-off-by: Colin Ian King <colin.i.king@...il.com>
> ---
> fs/jffs2/compr_rubin.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/fs/jffs2/compr_rubin.c b/fs/jffs2/compr_rubin.c
> index 556de100ebd5..9854253d0108 100644
> --- a/fs/jffs2/compr_rubin.c
> +++ b/fs/jffs2/compr_rubin.c
> @@ -276,11 +276,6 @@ static int rubin_do_compress(int bit_divider, int *bits, unsigned char *data_in,
>
> end_rubin(&rs);
>
Maybe this check could detect the overflow of 'pos', I guess.
> - if (outpos > pos) {
> - /* We failed */
> - return -1;
> - }
> -
> /* Tell the caller how much we managed to compress,
> * and how much space it took */
>
>
Powered by blists - more mailing lists