qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 3/3] timer/exynos4210_mct: Remove redundant statement in e


From: Laurent Vivier
Subject: Re: [PATCH v4 3/3] timer/exynos4210_mct: Remove redundant statement in exynos4210_mct_write()
Date: Tue, 24 Mar 2020 14:21:28 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0

Le 24/03/2020 à 13:22, Chenqun (kuhn) a écrit :
>> -----Original Message-----
>> From: Laurent Vivier [mailto:address@hidden]
>> Sent: Tuesday, March 24, 2020 6:59 PM
>> To: Chenqun (kuhn) <address@hidden>; address@hidden;
>> address@hidden
>> Cc: Zhanghailiang <address@hidden>; address@hidden;
>> Euler Robot <address@hidden>; Igor Mitsyanko
>> <address@hidden>; Peter Maydell <address@hidden>
>> Subject: Re: [PATCH v4 3/3] timer/exynos4210_mct: Remove redundant
>> statement in exynos4210_mct_write()
>>
>> Le 24/03/2020 à 09:22, Chen Qun a écrit :
>>> Clang static code analyzer show warning:
>>> hw/timer/exynos4210_mct.c:1370:9: warning: Value stored to 'index' is never
>> read
>>>         index = GET_L_TIMER_CNT_REG_IDX(offset, lt_i);
>>>         ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>> hw/timer/exynos4210_mct.c:1399:9: warning: Value stored to 'index' is never
>> read
>>>         index = GET_L_TIMER_CNT_REG_IDX(offset, lt_i);
>>>         ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>> hw/timer/exynos4210_mct.c:1441:9: warning: Value stored to 'index' is never
>> read
>>>         index = GET_L_TIMER_CNT_REG_IDX(offset, lt_i);
>>>         ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> It would be interesting to understand why we need the index for these 
>> registers
>> in exynos4210_mct_read() and not in exynos4210_mct_write().
>>
> I think the index can also be used in exynos4210_mct_write(), but the 
> original author used a more obvious reg name instead of it.
> 
> The obvious reg name:
> case L0_TCNTB: case L1_TCNTB:
>            reg name is :  L_REG_CNT_TCNTB 
> 
> case L0_ICNTB: case L1_ICNTB:
>            reg name is :   L_REG_CNT_ICNTB
> 
> case L0_FRCNTB: case L1_FRCNTB:
>            reg name is :   L_REG_CNT_FRCCNTB
>

Yes, you're right.

Computed index gives the value used with s->l_timer[lt_i].reg.cnt[].

Reviewed-by: Laurent Vivier <address@hidden>

Thanks,
Laurent




reply via email to

[Prev in Thread] Current Thread [Next in Thread]