Skip to content

Commit

Permalink
LoongArch/crypto: Clean up useless assignment operations
Browse files Browse the repository at this point in the history
[ Upstream commit fea1c94 ]

The LoongArch CRC32 hw acceleration is based on arch/mips/crypto/
crc32-mips.c. While the MIPS code supports both MIPS32 and MIPS64,
but LoongArch32 lacks the CRC instruction. As a result, the line
"len -= sizeof(u32)" is unnecessary.

Removing it can make context code style more unified and improve
code readability.

Cc: stable@vger.kernel.org
Reviewed-by: WANG Xuerui <git@xen0n.name>
Suggested-by: Wentao Guan <guanwentao@uniontech.com>
Signed-off-by: Yuli Wang <wangyuli@uniontech.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Avenger-285714 authored and gregkh committed Apr 3, 2024
1 parent 0b61a7d commit 610b851
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions arch/loongarch/crypto/crc32-loongarch.c
Expand Up @@ -44,7 +44,6 @@ static u32 crc32_loongarch_hw(u32 crc_, const u8 *p, unsigned int len)

CRC32(crc, value, w);
p += sizeof(u32);
len -= sizeof(u32);
}

if (len & sizeof(u16)) {
Expand Down Expand Up @@ -80,7 +79,6 @@ static u32 crc32c_loongarch_hw(u32 crc_, const u8 *p, unsigned int len)

CRC32C(crc, value, w);
p += sizeof(u32);
len -= sizeof(u32);
}

if (len & sizeof(u16)) {
Expand Down

0 comments on commit 610b851

Please sign in to comment.