• Borislav Petkov's avatar
    cpufreq: intel_pstate: Fix an annoying !CONFIG_SMP warning · 64df1fdf
    Borislav Petkov authored
    I keep seeing
    
      drivers/cpufreq/intel_pstate.c: In function ‘intel_pstate_init’:
      drivers/cpufreq/intel_pstate.c:1187:26: warning: initialization from incompatible pointer type
        struct cpuinfo_x86 *c = &boot_cpu_data;
    
    when doing randconfig builds.
    
    This is caused by the fact that when !CONFIG_SMP, asm/processor.h
    defines cpu_info to boot_cpu_data and the local variable
    
      struct cpu_defaults *cpu_info
    
    overshadows it leading to this unfortunate assignment in the
    preprocessed source:
    
     struct cpu_defaults *boot_cpu_data;
     struct cpuinfo_x86 *c = &boot_cpu_data;
    
    Rename the local variable and use static_cpu_has_safe() which alleviates
    the need for defining a local cpuinfo_x86 pointer.
    Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
    Acked-by: default avatarKristen Carlson Accardi <kristen@linux.intel.com>
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    64df1fdf
intel_pstate.c 28.9 KB