[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





On 27/10/23 09:07, Jan Beulich wrote:
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>


These changes were not intended, I'm sorry.
I'll submit a v2. I also noticed that there are a few places left
where the coding style can still be improved.

--
Federico Serafini, M.Sc.

Software Engineer, BUGSENG (http://bugseng.com)



 


Rackspace

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