[PATCH v1] bsps/aarch64: explicit cast uint64_t to ISR_Level

Gedare Bloom gedare at rtems.org
Mon Jan 22 17:04:25 UTC 2024


On Wed, Jan 17, 2024 at 1:48 AM <tianye at sugon.com> wrote:
>
> From: Chengxiang Li <lichx2 at sugon.com>
>
> avoid pclint err
> ---
>  cpukit/score/cpu/aarch64/include/rtems/score/cpu.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/cpukit/score/cpu/aarch64/include/rtems/score/cpu.h b/cpukit/score/cpu/aarch64/include/rtems/score/cpu.h
> index aa4f90f1a8..569b6bcee2 100644
> --- a/cpukit/score/cpu/aarch64/include/rtems/score/cpu.h
> +++ b/cpukit/score/cpu/aarch64/include/rtems/score/cpu.h
> @@ -251,7 +251,7 @@ static inline void AArch64_interrupt_flash( uint64_t isr_cookie )
>
>  #define _CPU_ISR_Disable( _isr_cookie ) \
>    do { \
> -    _isr_cookie = AArch64_interrupt_disable(); \
> +    _isr_cookie = (ISR_Level)AArch64_interrupt_disable(); \

This is down-casting a 64-bit value to a 32-bit value. I think my
preference would be to check if the AArch64_interrupt_disable() should
be returning a 32-bit value instead.

CC: Kinsey

>    } while (0)
>
>  #define _CPU_ISR_Enable( _isr_cookie )  \
> --
> 2.34.1
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel


More information about the devel mailing list