On 08.05.2023 13:56, Jan Beulich wrote:
> On 01.05.2023 21:30, Jason Andryuk wrote:
>> +static int parse_hwp_opts(xc_set_hwp_para_t *set_hwp, int *cpuid,
>> +                          int argc, char *argv[])
>> +{
>> +    int i = 0;
>> +
>> +    if ( argc < 1 ) {
>> +        fprintf(stderr, "Missing arguments\n");
>> +        return -1;
>> +    }
>> +
>> +    if ( parse_cpuid_non_fatal(argv[i], cpuid) == 0 )
>> +    {
>> +        i++;
>> +    }
> 
> I don't think you need the earlier patch and the separate helper:
> Whether a CPU number is present can be told by checking
> isdigit(argv[i][0]).

Hmm, yes, there is "all", but your help text doesn't mention it and
since you're handling a variable number of arguments anyway, there's
not need for anyone to say "all" - they can simply omit the optional
argument.

Jan

Reply via email to