]> git.ipfire.org Git - thirdparty/linux.git/commit
crypto: mips/crc32 - Clean up useless assignment operations
authorWangYuli <wangyuli@uniontech.com>
Fri, 6 Sep 2024 06:40:02 +0000 (14:40 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 13 Sep 2024 10:26:52 +0000 (18:26 +0800)
commitca459e5f826f262f044bda85ede8460af7f4bec9
tree2fc327d74b8fe32e69ce3e769c86861f0484f73a
parentf29ca8f762d19f7e26913ee49325806cb55f2d8f
crypto: mips/crc32 - Clean up useless assignment operations

When entering the "len & sizeof(u32)" branch, len must be less than 8.
So after one operation, len must be less than 4.
At this time, "len -= sizeof(u32)" is not necessary for 64-bit CPUs.

After that, replace `while' loops with equivalent `for' to make the
code structure a little bit better by the way.

Suggested-by: Maciej W. Rozycki <macro@orcam.me.uk>
Link: https://lore.kernel.org/all/alpine.DEB.2.21.2406281713040.43454@angie.orcam.me.uk/
Suggested-by: Herbert Xu <herbert@gondor.apana.org.au>
Link: https://lore.kernel.org/all/ZtqZpzMH_qMQqzyc@gondor.apana.org.au/
Signed-off-by: Guan Wentao <guanwentao@uniontech.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/mips/crypto/crc32-mips.c