[PATCH v2 4/4] lib: sbi: Fix fw_event_map initialization

Andrew Jones ajones at ventanamicro.com
Wed Jul 20 03:40:08 PDT 2022


On Tue, Jul 19, 2022 at 03:46:15PM -0700, Atish Patra wrote:
> fw_event_map represents array of firmware events. It should initialized
                                                             ^ be
> for maximum number of firmware events not counters.
     ^ the
> 
> Signed-off-by: Atish Patra <atishp at rivosinc.com>
> ---
>  lib/sbi/sbi_pmu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/sbi/sbi_pmu.c b/lib/sbi/sbi_pmu.c
> index a159d72ac6dc..a622054595c1 100644
> --- a/lib/sbi/sbi_pmu.c
> +++ b/lib/sbi/sbi_pmu.c
> @@ -757,7 +757,7 @@ static void pmu_reset_event_map(u32 hartid)
>  	/* Initialize the counter to event mapping table */
>  	for (j = 3; j < total_ctrs; j++)
>  		active_events[hartid][j] = SBI_PMU_EVENT_IDX_INVALID;
> -	for (j = 0; j < SBI_PMU_FW_CTR_MAX; j++)
> +	for (j = 0; j < SBI_PMU_FW_EVENT_MAX; j++)
>  		sbi_memset(&fw_event_map[hartid][j], 0,
>  			   sizeof(struct sbi_pmu_fw_event));
>  }
> -- 
> 2.25.1
>

Reviewed-by: Andrew Jones <ajones at ventanamicro.com>



More information about the opensbi mailing list