diff mbox series

[v2,3/5] lib: sbi: Removal unnecessary check dbtr_thishart_state_ptr

Message ID 20240423145743.392718-4-wxjstz@126.com
State Superseded
Headers show
Series miscellaneous about sbi_dtbr | expand

Commit Message

Xiang W April 23, 2024, 2:57 p.m. UTC
After getting hart_shmem_base, dbtr_thishart_state_ptr cannot be
empty. So remove check code.

Signed-off-by: Xiang W <wxjstz@126.com>
---
 lib/sbi/sbi_dbtr.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Himanshu Chauhan April 30, 2024, 9:38 a.m. UTC | #1
On 23/04/24 20:27, Xiang W wrote:
> After getting hart_shmem_base, dbtr_thishart_state_ptr cannot be
> empty. So remove check code.
> 
> Signed-off-by: Xiang W <wxjstz@126.com>
> ---
>   lib/sbi/sbi_dbtr.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/lib/sbi/sbi_dbtr.c b/lib/sbi/sbi_dbtr.c
> index ceff185..4093a82 100644
> --- a/lib/sbi/sbi_dbtr.c
> +++ b/lib/sbi/sbi_dbtr.c
> @@ -683,8 +683,6 @@ int sbi_dbtr_update_trig(unsigned long smode,
>   		return SBI_ERR_NO_SHMEM;
>   
>   	hs = dbtr_thishart_state_ptr();
> -	if (!hs)
> -		return SBI_ERR_FAILED;
>   
>   	for_each_set_bit_from(idx, &trig_mask, hs->total_trigs) {
>   		trig = INDEX_TO_TRIGGER(idx);

LGTM

Reviewed-by: Himanshu Chauhan <hchauhan@ventanamicro.com>

- Himanshu
diff mbox series

Patch

diff --git a/lib/sbi/sbi_dbtr.c b/lib/sbi/sbi_dbtr.c
index ceff185..4093a82 100644
--- a/lib/sbi/sbi_dbtr.c
+++ b/lib/sbi/sbi_dbtr.c
@@ -683,8 +683,6 @@  int sbi_dbtr_update_trig(unsigned long smode,
 		return SBI_ERR_NO_SHMEM;
 
 	hs = dbtr_thishart_state_ptr();
-	if (!hs)
-		return SBI_ERR_FAILED;
 
 	for_each_set_bit_from(idx, &trig_mask, hs->total_trigs) {
 		trig = INDEX_TO_TRIGGER(idx);