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

Re: [XEN PATCH] xen/set_{c,p}x_pminfo: address violations od MISRA C:2012 Rule 8.3


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Federico Serafini <federico.serafini@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 27 Oct 2023 09:07:59 +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=Ia8vcCymjpiYknAAqLNayVWtaXeHdJ9Y36tiSByw/WA=; b=R05KhGIDWGllk4QSkI1uvyiUHC325EcTIdsrJHZc5VRbYKwSKsV/5xkZlr93jDGTEy79n/Lh3hi2uUw2pWaa0Pix0gkTZCtKa0tX1vQMyMCo4OH+T/VT1Xrt5IDD/15ERIPw6VkOZmvtNU7K5PomTnD9DuazQYtCoi0MsMMLgfdvRGXAS3J4orP9LFeHOFg9ee5xDOVQna9HFn6w/QKwrdXTxlE4NryvtPQ6fIMnuEtjeq/NJI4k7G107ghprXOXKBUKA9akwu6MNKENvvkXV7DqiFyFz3opeVR9fXNtylIuy0XXKlbs+La48OaG5LAqfSBEqcp3x/bpqRHyPGFbfQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dWE1LiBjiFQknUYec/q3YJOyGKFXZyWvblIZbrJJ6WHWmyo3+lN3NMQmIGcgoQQwszVU8HrX4/ToI2rvfSUFsnEK8jVI+Q0tl6ptM8l9s0qGtBBpvVKlsLSIVkwwPVR+C3sa5WLYWbewo2tk7Ljy9i/UjQvY2kLruxo3IiYGHpIlxLBcScWXwOOrpRs/qZzeiDuQF9R9dN43PhEK9QRTKLz/SnmuqZwACqR/wxezMQQj9iNHftANpwjPM6AVgKMAPvEApcibxkkMIULvCRlVvG5XuHgWpp/mIFWXBJKcpMuVSKGKGL6pxd6eKjmgyTFbNPwNet+ZaQq9tCqg2xasGQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, consulting@xxxxxxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>
  • Delivery-date: Fri, 27 Oct 2023 07:08:16 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 27.10.2023 01:00, Stefano Stabellini wrote:
> On Thu, 26 Oct 2023, Federico Serafini wrote:
>> @@ -675,16 +673,16 @@ static int __init cpufreq_cmdline_parse(const char *s, 
>> const char *e)
>>  static int cf_check cpu_callback(
>>      struct notifier_block *nfb, unsigned long action, void *hcpu)
>>  {
>> -    unsigned int cpu = (unsigned long)hcpu;
>> +    unsigned int acpi_id = (unsigned long)hcpu;
>>  
>>      switch ( action )
>>      {
>>      case CPU_DOWN_FAILED:
>>      case CPU_ONLINE:
>> -        (void)cpufreq_add_cpu(cpu);
>> +        (void)cpufreq_add_cpu(acpi_id);
>>          break;
>>      case CPU_DOWN_PREPARE:
>> -        (void)cpufreq_del_cpu(cpu);
>> +        (void)cpufreq_del_cpu(acpi_id);
>>          break;
>>      default:
>>          break;
> 
> I take you made these changes to cpu_callback for consistency, not
> because they are required? Everything else makes sense so:

I'm sorry, but no, these changes are not only not required, they're
outright wrong. CPU callbacks never talk in terms of ACPI IDs. The
two functions called also aren't otherwise altered in this patch,
and both take "unsigned int cpu".

Jan

> Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>




 


Rackspace

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