projects
/
platform
/
kernel
/
opensbi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7aa80ea
)
lib: sbi: sse: simplify 32bits overflow check
author
Clément Léger
<cleger@rivosinc.com>
Tue, 9 Apr 2024 10:02:04 +0000
(12:02 +0200)
committer
Anup Patel
<anup@brainfault.org>
Tue, 7 May 2024 11:56:14 +0000
(17:26 +0530)
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
patch
|
blob
|
history
diff --git
a/lib/sbi/sbi_sse.c
b/lib/sbi/sbi_sse.c
index 0f8b34767b8e48e0ac17c271482687bc0b402428..1b6048d852630bdc1af85114636c2cafc399f2af 100644
(file)
--- 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;
}