linux/drivers/powercap
Zhang Rui 16e95a62ee powercap: intel_rapl: Fix a sparse warning in TPMI interface
Depends on the interface used, the RAPL registers can be either MSR
indexes or memory mapped IO addresses. Current RAPL common code uses u64
to save both MSR and memory mapped IO registers. With this, when
handling register address with an __iomem annotation, it triggers a
sparse warning like below:

sparse warnings: (new ones prefixed by >>)
>> drivers/powercap/intel_rapl_tpmi.c:141:41: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned long long [usertype] *tpmi_rapl_regs @@     got void [noderef] __iomem * @@
   drivers/powercap/intel_rapl_tpmi.c:141:41: sparse:     expected unsigned long long [usertype] *tpmi_rapl_regs
   drivers/powercap/intel_rapl_tpmi.c:141:41: sparse:     got void [noderef] __iomem *

Fix the problem by using a union to save the registers instead.

Suggested-by: David Laight <David.Laight@ACULAB.COM>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202307031405.dy3druuy-lkp@intel.com/
Tested-by: Wang Wendy <wendy.wang@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2023-08-01 13:45:08 +02:00
..
arm_scmi_powercap.c powercap: arm_scmi: Add support for disabling powercaps on a zone 2023-06-06 14:05:10 +01:00
dtpm_cpu.c Power management updates for 5.20-rc1 2022-08-02 11:17:00 -07:00
dtpm_devfreq.c powercap/drivers/dtpm: Add dtpm devfreq with energy model support 2022-02-04 17:38:09 +01:00
dtpm_subsys.h powercap/drivers/dtpm: Add dtpm devfreq with energy model support 2022-02-04 17:38:09 +01:00
dtpm.c powercap: DTPM: Fix spelling mistake "initialze" -> "initialize" 2022-03-01 18:59:35 +01:00
idle_inject.c Thermal control updates for 6.3-rc1 2023-02-21 12:32:05 -08:00
intel_rapl_common.c powercap: intel_rapl: Fix a sparse warning in TPMI interface 2023-08-01 13:45:08 +02:00
intel_rapl_msr.c powercap: intel_rapl: Fix a sparse warning in TPMI interface 2023-08-01 13:45:08 +02:00
intel_rapl_tpmi.c powercap: intel_rapl: Fix a sparse warning in TPMI interface 2023-08-01 13:45:08 +02:00
Kconfig powercap: RAPL: Fix CONFIG_IOSF_MBI dependency 2023-06-12 19:48:40 +02:00
Makefile powercap: intel_rapl: Introduce RAPL TPMI interface driver 2023-05-24 18:46:20 +02:00
powercap_sys.c powercap: remove MODULE_LICENSE in non-modules 2023-02-28 21:32:05 +01:00