From: Zhihao Cheng <chengzhihao1@huawei.com>
To: Colin Ian King <colin.i.king@gmail.com>,
David Woodhouse <dwmw2@infradead.org>,
Richard Weinberger <richard@nod.at>,
<linux-mtd@lists.infradead.org>
Cc: <kernel-janitors@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] jffs2: remove redundant check on outpos > pos
Date: Wed, 30 Oct 2024 12:45:42 +0800 [thread overview]
Message-ID: <cf07a880-1429-cc75-657e-55b32841cc00@huawei.com> (raw)
In-Reply-To: <20241029222015.3069873-1-colin.i.king@gmail.com>
在 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@gmail.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 */
>
>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2024-10-30 4:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-29 22:20 [PATCH] jffs2: remove redundant check on outpos > pos Colin Ian King
2024-10-30 4:45 ` Zhihao Cheng [this message]
2024-10-30 7:43 ` Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cf07a880-1429-cc75-657e-55b32841cc00@huawei.com \
--to=chengzhihao1@huawei.com \
--cc=colin.i.king@gmail.com \
--cc=dwmw2@infradead.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=richard@nod.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox