Skip to content

Commit b737fc2

Browse files
atishp04avpatel
authored andcommitted
RISC-V: Use the minor version mask while computing sbi version
As per the SBI specification, minor version is encoded in the lower 24 bits only. Make sure that the SBI version is computed with the appropriate mask. Currently, there is no minor version in use. Thus, it doesn't change anything functionality but it is good to be compliant with the specification. Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Acked-by: Palmer Dabbelt <palmer@rivosinc.com> Signed-off-by: Atish Patra <atishp@rivosinc.com> Link: https://lore.kernel.org/r/20240420151741.962500-8-atishp@rivosinc.com Signed-off-by: Anup Patel <anup@brainfault.org>
1 parent 3ddb6d4 commit b737fc2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • arch/riscv/include/asm

arch/riscv/include/asm/sbi.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,8 @@ static inline unsigned long sbi_minor_version(void)
367367
static inline unsigned long sbi_mk_version(unsigned long major,
368368
unsigned long minor)
369369
{
370-
return ((major & SBI_SPEC_VERSION_MAJOR_MASK) <<
371-
SBI_SPEC_VERSION_MAJOR_SHIFT) | minor;
370+
return ((major & SBI_SPEC_VERSION_MAJOR_MASK) << SBI_SPEC_VERSION_MAJOR_SHIFT)
371+
| (minor & SBI_SPEC_VERSION_MINOR_MASK);
372372
}
373373

374374
int sbi_err_map_linux_errno(int err);

0 commit comments

Comments
 (0)