[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 14/15] xenpm: Add set-cpufreq-cppc subcommand
- To: Jason Andryuk <jandryuk@xxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Mon, 19 Jun 2023 16:54:23 +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=SFGjCNmT98+Oxv79gkK71c/wS1nDauxB+D+JaV3HcjA=; b=cSE8eypah2/G/BcLkWXx84Cc3Na4hD7XAdh1fvrt/PfB+4O/jjoAssJ34VyGhWE0QTRcmzqTBIWG7o8hzLn1uS2Lw5jWXfbXeKHnlPSiYApD1zLncU8y99egBILoGmQnJ6Ik73Ahyb+J9sWtUYdrEsUmLmZPINPXKgiRgtmK+K44RmNA0lHhGb1E0SItTCR3mV71WtJVYNxoDV1wHUbuiQ6Oel6vJADcuEKLE28SexcmsXw/7Z/tKvDyQjOrdu5PAwVipmFcjf073QR2c9AIMgUWobmf3ecBujbzTIJFleNZ+3ugiHRgHPxDBIGVBK2ZKI+vlN78FI7xkGcdBN4jLA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cpF3ZPRGJ8DeBYv6haY8X4aBwtE0g7CiicIqTFuN9fU+fjlcvDD5EI5a8XeorH/liOinXQUn5bTE8t3ai6zsCTIheIJl4acfpvLZVmrLO1tfHqmtl+ikF1Hki7FxR9EpHKBhSmLR21r86czX2jyYSUSdhSpJvFyfKiR47GYXZ3OBLNmnA7symz+IeK+PBVmhrSYgwAzD/UYVDlH4RNA748ius/yJfSuXvG2SDtkJEubWS5PkHATJ7D4/0MrI6MWsJgqS04OetfL7vPCJjb2HUNN2DBAEI6pQ0Gg01jgKEtTwbaQIGZZjsxgbQSx/FhaOWY3gV+GlvjHtSWTtHRHXjg==
- 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, 19 Jun 2023 14:54:37 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 14.06.2023 20:02, Jason Andryuk wrote:
> +static void cppc_set_func(int argc, char *argv[])
> +{
> + xc_set_cppc_para_t set_cppc = {};
> + int cpuid = -1;
> + int i = 0;
While cpuid needs to remain of signed type, i wants to be unsigned int.
> + if ( parse_cppc_opts(&set_cppc, &cpuid, argc, argv) )
> + exit(EINVAL);
> +
> + if ( cpuid != -1 )
> + {
> + i = cpuid;
> + max_cpu_nr = i + 1;
While it looks like (ab)using the global variable this way is okay for
now, I'd prefer if you added a local variable instead, such that the
global can retain its meaning. Then
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
Jan
|