lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 4 Jun 2018 12:40:37 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Lee Jones <lee.jones@...aro.org>
Cc:     Charles Keepax <ckeepax@...nsource.cirrus.com>,
        patches@...nsource.cirrus.com,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mfd: arizona: Don't use regmap_read_poll_timeout

On Mon, Jun 4, 2018 at 8:44 AM, Lee Jones <lee.jones@...aro.org> wrote:
> On Fri, 11 May 2018, Charles Keepax wrote:

>> +     while (true) {
>> +             ret = regmap_read(arizona->regmap, reg, &val);
>>
>> +             if ((val & mask) == target)
>> +                     return 0;
>> +
>> +             if (ktime_compare(ktime_get(), timeout) > 0)
>> +                     break;
>> +
>> +             usleep_range(ARIZONA_REG_POLL_DELAY_US / 2,
>> +                          ARIZONA_REG_POLL_DELAY_US);
>> +     }

>From my point of view infinite loops not good for readability and maintenance.
Perhaps

do {
...
} while (ktime_compare(...));

?

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ