diff options
| author | Clément Léger <[email protected]> | 2024-04-09 12:02:04 +0200 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2024-05-07 17:26:14 +0530 |
| commit | 22ff75099c53a4bac72abc3fa10157aabeb3ce49 (patch) | |
| tree | c49f995faa9de4e3505add53805d83abec1c63f3 | |
| parent | 7aa80ea4954ea369dba8f5864a1386342c44d806 (diff) | |
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 <[email protected]>
Reported-by: Samuel Holland <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
| -rw-r--r-- | lib/sbi/sbi_sse.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sbi/sbi_sse.c b/lib/sbi/sbi_sse.c index 0f8b3476..1b6048d8 100644 --- a/lib/sbi/sbi_sse.c +++ b/lib/sbi/sbi_sse.c @@ -344,7 +344,7 @@ static int sse_event_set_attr_check(struct sbi_sse_event *e, uint32_t attr_id, break; case SBI_SSE_ATTR_PRIO: #if __riscv_xlen > 32 - if (val > 0xFFFFFFFFUL) { + if (val != (uint32_t)val) { ret = SBI_EINVAL; break; } |
