[PATCH v4 1/2] power: introduce PM QoS API on CPU wide
lihuisong (C)
lihuisong at huawei.com
Fri Jun 28 06:07:08 CEST 2024
在 2024/6/27 23:06, Stephen Hemminger 写道:
> On Thu, 27 Jun 2024 14:00:10 +0800
> Huisong Li <lihuisong at huawei.com> wrote:
>
>> + char buf[BUFSIZ] = {0};
> BUFSIZ is 4K and you probably don't need all of that.
I rember the maximum buffer length of sysfs show in Linux is BUFSIZ.
Just from the same size, here is ok to receive the data from Linux.
But LINE_MAX is also enough to use.
> And initializing to 0 here should not be needed.
Ack
>
> Why not:
> char buf[LINE_MAX];
Thanks for your suggestion. use it in next version.
>> + if (latency == 0)
>> + sprintf(buf, "%s", "n/a");
>> + else if (latency == RTE_POWER_QOS_RESUME_LATENCY_NO_CONSTRAINT)
>> + sprintf(buf, "%u", 0);
>> + else
>> + sprintf(buf, "%u", latency);
> Use snprintf instead.
Ack
> .
More information about the dev
mailing list