lkml.org 
[lkml]   [2021]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [PATCH V6 08/20] rtla: Helper functions for rtla
    From
    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

    \
     
     \ /
      Last update: 2021-10-27 18:24    [W:2.716 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site