diff options
author | Zhang Rui <[email protected]> | 2023-07-25 13:39:12 +0800 |
---|---|---|
committer | Rafael J. Wysocki <[email protected]> | 2023-08-01 13:45:08 +0200 |
commit | 16e95a62eed18864aecac404f1e4eed764c363f2 (patch) | |
tree | 70d77f724539bb5a1ca8163dacc97bd6713f1876 /lib/test-string_helpers.c | |
parent | 5d0c230f1de8c7515b6567d9afba1f196fb4e2f4 (diff) |
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 <[email protected]>
Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Tested-by: Wang Wendy <[email protected]>
Signed-off-by: Zhang Rui <[email protected]>
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <[email protected]>
Diffstat (limited to 'lib/test-string_helpers.c')
0 files changed, 0 insertions, 0 deletions