[U-Boot] [PATCH] ARM: mxs: rename function that sets AUTO_RESTART flag

Stefano Babic sbabic at denx.de
Fri Jul 26 10:50:59 CEST 2013


Hi Hector,

On 24/07/2013 18:08, Hector Palacios wrote:
>> Why? The comment seems fully valid to me.
> 
> The comment is confusing for a number of reasons:
> - It says for revision A of the EVK the flag must be enabled but the
> code is common for all platforms and there is no distinction about the
> platform where it runs. The flag must be enabled for any platform.
> - The flag is set by the function in any case (except if it is already
> set) so the comment superfluous.
> - The comment doesn't even say what the problem is on EVK_A or why the
> setting of the bit helps.

Right, I see the same. The comment hides some information, because we do
not know which is the issue and in any case code does the opposite,
setting the bit in any case. I think it is better to drop it.

>>> -static void mxs_power_clear_auto_restart(void)
>>> +static void mxs_power_set_auto_restart(void)
>>>   {
>>>       struct mxs_rtc_regs *rtc_regs =
>>>           (struct mxs_rtc_regs *)MXS_RTC_BASE;
>>> @@ -65,10 +65,7 @@ static void mxs_power_clear_auto_restart(void)
>>>       while (readl(&rtc_regs->hw_rtc_ctrl) & RTC_CTRL_CLKGATE)
>>>           ;
>>>
>>> -    /*
>>> -     * Due to the hardware design bug of mx28 EVK-A
>>> -     * we need to set the AUTO_RESTART bit.
>>> -     */
>>> +    /* Do nothing if flag already set */
>>
>> You're changing the behavior here and it's not documented. I see no
>> point in
>> this change while at it.
> 
> I'm not changing the behavior. I just renamed the function to reflect
> what the function does, which is set the flag, not clear it. Apart from
> the renaming, I didn't touch a line of real code.

I see also no changes in behavior, it is only a rename.

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================


More information about the U-Boot mailing list