[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 13/14 RESEND] xenpm: Add set-cpufreq-hwp subcommand


  • To: Jason Andryuk <jandryuk@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 8 May 2023 14:00:05 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4M0gQIPPWYu6lNbkmP6JNCTOctzFQmfMgVZacHhWJYc=; b=YKUJ8BH9tHGliB0FlMrj0Pi/THqin9aP7QmmEJ62WgI2viDyyjVEH6Gj5WSFsjBXwpN5bo5g9Os5IsnDTlWLygqHw62p3zeifiMbWaPB+0ZqTsqJPl8VjHGN/3H3rFJziq6acbXuV8bFmbKnrD/1/qz39kK7VqkD0ul5LKphCPDBgmmBzShqcQXqnlZgzQ34x+ofbvGIPE86Qg1+FLK0fh6GLDZ7z80krkptmNu3s1/ZGfARIxs9eQODJv/16DPh5sMntS97Clx1x3+Q1zVljnaH8OnGpQoBB8q7HKOyt8sgynxJ0eQsylfR53/X9rvaxhTvrcIYJbcQ61PCs1XGcw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FWaarnc7WHtr7skPNu0spU4YFksv3ExLcY+5q1UpCD5HsHzSq1OND2FxcjKoOiONeLy7syofS8W3bUWLafkpnbTANhDXzLJTDont1K8hlEF4RafyBE2Cef227MbJSsG/OhGmCJmg2u6K9B8bOSrN9KYMYjZ+cCuK4uVTi9njNKtQKYoYIu4Lu5VV8b7hGcIfqYodSqGbyGGqkJCcMS/gWRqyn+Xb6m6uDdNjoM+sdnJADEnV/kBIEKW2PrF1h9Qxpkjd+x9sXIO1JHiYGc3yy6ek5TTBfAyuqeCWVbd9qKJst3wBK8OIk8OWU8RaOz7P9GYetnrqF7jhwS2a4sxnSw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 08 May 2023 12:00:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.