lib: sbi: sse: simplify 32bits overflow check
authorClément Léger <cleger@rivosinc.com>
Tue, 9 Apr 2024 10:02:04 +0000 (12:02 +0200)
committerAnup Patel <anup@brainfault.org>
Tue, 7 May 2024 11:56:14 +0000 (17:26 +0530)
commit22ff75099c53a4bac72abc3fa10157aabeb3ce49
treec49f995faa9de4e3505add53805d83abec1c63f3
parent7aa80ea4954ea369dba8f5864a1386342c44d806
lib: sbi: sse: simplify 32bits overflow check

Rather than checking 32bits overflow with some absolute value, check the
value to be different from the cast itself.

Signed-off-by: Clément Léger <cleger@rivosinc.com>
Reported-by: Samuel Holland <samuel.holland@sifive.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
lib/sbi/sbi_sse.c