drivers/thermal/intel/int340x_thermal/processor_thermal_rapl.c:96:50: sparse: sparse: cast removes address space '__iomem' of expression

From: kernel test robot
Date: Mon Feb 14 2022 - 16:34:40 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 754e0b0e35608ed5206d6a67a791563c631cec07
commit: a5923b6c3137b9d4fc2ea1c997f6e4d51ac5d774 thermal: int340x: processor_thermal: Refactor MMIO interface
date: 1 year, 2 months ago
config: x86_64-randconfig-s022-20220214 (https://download.01.org/0day-ci/archive/20220215/202202150359.0tDKN8pA-lkp@xxxxxxxxx/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a5923b6c3137b9d4fc2ea1c997f6e4d51ac5d774
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout a5923b6c3137b9d4fc2ea1c997f6e4d51ac5d774
# save the config file to linux build tree
mkdir build_dir
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash arch/x86/platform/pvh/ drivers/gpio/ drivers/mailbox/ drivers/media/cec/platform/meson/ drivers/media/cec/platform/tegra/ drivers/media/rc/ drivers/pwm/ drivers/regulator/ drivers/spi/ drivers/thermal/intel/int340x_thermal/ drivers/usb/gadget/udc/ kernel/sched/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)
>> drivers/thermal/intel/int340x_thermal/processor_thermal_rapl.c:96:50: sparse: sparse: cast removes address space '__iomem' of expression
drivers/thermal/intel/int340x_thermal/processor_thermal_rapl.c:100:36: sparse: sparse: cast removes address space '__iomem' of expression

vim +/__iomem +96 drivers/thermal/intel/int340x_thermal/processor_thermal_rapl.c

81
82 int proc_thermal_rapl_add(struct pci_dev *pdev, struct proc_thermal_device *proc_priv)
83 {
84 const struct rapl_mmio_regs *rapl_regs = &rapl_mmio_default;
85 enum rapl_domain_reg_id reg;
86 enum rapl_domain_type domain;
87 int ret;
88
89 if (!rapl_regs)
90 return 0;
91
92 for (domain = RAPL_DOMAIN_PACKAGE; domain < RAPL_DOMAIN_MAX; domain++) {
93 for (reg = RAPL_DOMAIN_REG_LIMIT; reg < RAPL_DOMAIN_REG_MAX; reg++)
94 if (rapl_regs->regs[domain][reg])
95 rapl_mmio_priv.regs[domain][reg] =
> 96 (u64)proc_priv->mmio_base +
97 rapl_regs->regs[domain][reg];
98 rapl_mmio_priv.limits[domain] = rapl_regs->limits[domain];
99 }
100 rapl_mmio_priv.reg_unit = (u64)proc_priv->mmio_base + rapl_regs->reg_unit;
101
102 rapl_mmio_priv.read_raw = rapl_mmio_read_raw;
103 rapl_mmio_priv.write_raw = rapl_mmio_write_raw;
104
105 rapl_mmio_priv.control_type = powercap_register_control_type(NULL, "intel-rapl-mmio", NULL);
106 if (IS_ERR(rapl_mmio_priv.control_type)) {
107 pr_debug("failed to register powercap control_type.\n");
108 return PTR_ERR(rapl_mmio_priv.control_type);
109 }
110
111 ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "powercap/rapl:online",
112 rapl_mmio_cpu_online, rapl_mmio_cpu_down_prep);
113 if (ret < 0) {
114 powercap_unregister_control_type(rapl_mmio_priv.control_type);
115 rapl_mmio_priv.control_type = NULL;
116 return ret;
117 }
118 rapl_mmio_priv.pcap_rapl_online = ret;
119
120 return 0;
121 }
122 EXPORT_SYMBOL_GPL(proc_thermal_rapl_add);
123

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx