lkml.org 
[lkml]   [2017]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] PM / QoS: Fix device resume latency PM QoS
On Wed, Oct 25, 2017 at 10:06 PM, Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Tue, Oct 24, 2017 at 11:49 AM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
>> On Tuesday, October 24, 2017 7:54:09 AM CEST Ramesh Thomas wrote:
>>> On 2017-10-20 at 13:27:34 +0200, Rafael J. Wysocki wrote:
>
>>> > static ssize_t pm_qos_resume_latency_store(struct device *dev,
>>> > @@ -228,11 +235,19 @@ static ssize_t pm_qos_resume_latency_sto
>>> > s32 value;
>>> > int ret;
>
>>> > + if (!kstrtos32(buf, 0, &value)) {
>>> > + /*
>>> > + * Prevent users from writing negative or "no constraint" values
>>> > + * directly.
>>> > + */
>>> > + if (value < 0 || value == PM_QOS_RESUME_LATENCY_NO_CONSTRAINT)
>>> > + return -EINVAL;
>
>>> > + if (value == 0)
>>> > + value = PM_QOS_RESUME_LATENCY_NO_CONSTRAINT;
>>> > + } else if (!strcmp(buf, "n/a") || !strcmp(buf, "n/a\n")) {
>>>
>>> Can the 2 checks for "n/a" be combined by checking first 3 characters?
>>
>> No, because "n/asomething" would then match too.
>
> If I don't missed anything, kernfs is aware of \n which means the
> first check is enough.
> Am I correct?

I'm not sure, honestly. :-)

Anyway, that can be fixed up later and the bug in question is rather urgent.

Thanks,
Rafael

\
 
 \ /
  Last update: 2017-10-26 10:38    [W:0.810 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site