Re: [PATCH V6 08/20] rtla: Helper functions for rtla
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: [PATCH V6 08/20] rtla: Helper functions for rtla
- From: Daniel Bristot de Oliveira <bristot@xxxxxxxxxx>
- Date: Wed, 27 Oct 2021 18:24:01 +0200
- Cc: Ingo Molnar <mingo@xxxxxxxxxx>, Tom Zanussi <zanussi@xxxxxxxxxx>, Masami Hiramatsu <mhiramat@xxxxxxxxxx>, Juri Lelli <juri.lelli@xxxxxxxxxx>, Clark Williams <williams@xxxxxxxxxx>, John Kacur <jkacur@xxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>, linux-rt-users@xxxxxxxxxxxxxxx, linux-trace-devel@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
- In-reply-to: <YXlcBhnqiKVxV4UX@geo.homenetwork>
- References: <cover.1635284863.git.bristot@kernel.org> <183637700a31169e5d6d1c8a827c5365599ec806.1635284863.git.bristot@kernel.org> <YXlcBhnqiKVxV4UX@geo.homenetwork>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0
On 10/27/21 16:02, Tao Zhou wrote:
>> +/*
>> + * parse_ns_duration - parse duration with ns/us/ms/s converting it to nanoseconds
>> + */
>> +long parse_ns_duration(char *val)
>> +{
>> + char *end;
>> + long t;
>> +
>> + t = strtol(val, &end, 10);
>> +
>> + if (end) {
>> + if (!strncmp(end, "ns", 2)) {
>> + return t;
>> + } else if (!strncmp(end, "us", 2)) {
>> + t *= 1000;
>> + return t;
>> + } else if (!strncmp(end, "ms", 2)) {
>> + t *= 1000 * 1000;
>> + return t;
>> + } else if (!strncmp(end, "s", 1)) {
>> + t *= 1000 * 1000 * 100;
> ^^^
> Ah, 1000 not 100.
yep, I will fix that. Thanks!
Steven, I am tempted to start placing fixes patches on top of this series. What
do you think?
-- Daniel
[Index of Archives]
[Linux USB Development]
[Linux USB Development]
[Linux Audio Users]
[Yosemite Hiking]
[Linux Kernel]
[Linux SCSI]