* [robh:dt/const 1/7] drivers/of/address.c:244:46: sparse: sparse: incorrect type in argument 1 (different modifiers)
@ 2024-10-09 17:16 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-10-09 17:16 UTC (permalink / raw)
To: Rob Herring (Arm); +Cc: oe-kbuild-all
tree: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git dt/const
head: 0c30153b6de7566ccbcf7c5c8857d33bc7fd3f29
commit: e54d6b14c85698083dc77dabcd7eb82cd5e30303 [1/7] of: Constify struct device_node
config: arc-randconfig-r131-20241009 (https://download.01.org/0day-ci/archive/20241010/202410100144.ew576shS-lkp@intel.com/config)
compiler: arc-elf-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20241010/202410100144.ew576shS-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410100144.ew576shS-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/of/address.c:244:46: sparse: sparse: incorrect type in argument 1 (different modifiers) @@ expected struct fwnode_handle *fwnode @@ got struct fwnode_handle const * @@
drivers/of/address.c:244:46: sparse: expected struct fwnode_handle *fwnode
drivers/of/address.c:244:46: sparse: got struct fwnode_handle const *
vim +244 drivers/of/address.c
1a52a094c2f082 Thomas Weißschuh 2024-09-06 217
0b0b0893d49b34 Liviu Dudau 2014-09-29 218 /*
0b0b0893d49b34 Liviu Dudau 2014-09-29 219 * of_pci_range_to_resource - Create a resource from an of_pci_range
0b0b0893d49b34 Liviu Dudau 2014-09-29 220 * @range: the PCI range that describes the resource
0b0b0893d49b34 Liviu Dudau 2014-09-29 221 * @np: device node where the range belongs to
0b0b0893d49b34 Liviu Dudau 2014-09-29 222 * @res: pointer to a valid resource that will be updated to
0b0b0893d49b34 Liviu Dudau 2014-09-29 223 * reflect the values contained in the range.
0b0b0893d49b34 Liviu Dudau 2014-09-29 224 *
65b6b046e2b4ce Geert Uytterhoeven 2023-03-31 225 * Returns -EINVAL if the range cannot be converted to resource.
0b0b0893d49b34 Liviu Dudau 2014-09-29 226 *
0b0b0893d49b34 Liviu Dudau 2014-09-29 227 * Note that if the range is an IO range, the resource will be converted
0b0b0893d49b34 Liviu Dudau 2014-09-29 228 * using pci_address_to_pio() which can fail if it is called too early or
0b0b0893d49b34 Liviu Dudau 2014-09-29 229 * if the range cannot be matched to any host bridge IO space (our case here).
0b0b0893d49b34 Liviu Dudau 2014-09-29 230 * To guard against that we try to register the IO range first.
0b0b0893d49b34 Liviu Dudau 2014-09-29 231 * If that fails we know that pci_address_to_pio() will do too.
0b0b0893d49b34 Liviu Dudau 2014-09-29 232 */
e54d6b14c85698 Rob Herring (Arm 2024-05-31 233) int of_pci_range_to_resource(const struct of_pci_range *range,
e54d6b14c85698 Rob Herring (Arm 2024-05-31 234) const struct device_node *np, struct resource *res)
83bbde1cc0ec9d Liviu Dudau 2014-09-29 235 {
1a52a094c2f082 Thomas Weißschuh 2024-09-06 236 u64 start;
0b0b0893d49b34 Liviu Dudau 2014-09-29 237 int err;
83bbde1cc0ec9d Liviu Dudau 2014-09-29 238 res->flags = range->flags;
83bbde1cc0ec9d Liviu Dudau 2014-09-29 239 res->parent = res->child = res->sibling = NULL;
83bbde1cc0ec9d Liviu Dudau 2014-09-29 240 res->name = np->full_name;
0b0b0893d49b34 Liviu Dudau 2014-09-29 241
0b0b0893d49b34 Liviu Dudau 2014-09-29 242 if (res->flags & IORESOURCE_IO) {
0b0b0893d49b34 Liviu Dudau 2014-09-29 243 unsigned long port;
fcfaab30933bd1 Gabriele Paoloni 2018-03-15 @244 err = pci_register_io_range(&np->fwnode, range->cpu_addr,
fcfaab30933bd1 Gabriele Paoloni 2018-03-15 245 range->size);
0b0b0893d49b34 Liviu Dudau 2014-09-29 246 if (err)
0b0b0893d49b34 Liviu Dudau 2014-09-29 247 goto invalid_range;
0b0b0893d49b34 Liviu Dudau 2014-09-29 248 port = pci_address_to_pio(range->cpu_addr);
0b0b0893d49b34 Liviu Dudau 2014-09-29 249 if (port == (unsigned long)-1) {
0b0b0893d49b34 Liviu Dudau 2014-09-29 250 err = -EINVAL;
0b0b0893d49b34 Liviu Dudau 2014-09-29 251 goto invalid_range;
0b0b0893d49b34 Liviu Dudau 2014-09-29 252 }
1a52a094c2f082 Thomas Weißschuh 2024-09-06 253 start = port;
0b0b0893d49b34 Liviu Dudau 2014-09-29 254 } else {
1a52a094c2f082 Thomas Weißschuh 2024-09-06 255 start = range->cpu_addr;
4af971064977b0 Pavel Fedin 2015-10-08 256 }
1a52a094c2f082 Thomas Weißschuh 2024-09-06 257 return __of_address_resource_bounds(res, start, range->size);
0b0b0893d49b34 Liviu Dudau 2014-09-29 258
0b0b0893d49b34 Liviu Dudau 2014-09-29 259 invalid_range:
0b0b0893d49b34 Liviu Dudau 2014-09-29 260 res->start = (resource_size_t)OF_BAD_ADDR;
0b0b0893d49b34 Liviu Dudau 2014-09-29 261 res->end = (resource_size_t)OF_BAD_ADDR;
0b0b0893d49b34 Liviu Dudau 2014-09-29 262 return err;
83bbde1cc0ec9d Liviu Dudau 2014-09-29 263 }
bf6681ea533538 Manikanta Maddireddy 2018-01-11 264 EXPORT_SYMBOL(of_pci_range_to_resource);
dbbdee94734bf6 Grant Likely 2010-06-08 265
:::::: The code at line 244 was first introduced by commit
:::::: fcfaab30933bd151bd8cb4dd07b3f11d885bb611 PCI: Add fwnode handler as input param of pci_register_io_range()
:::::: TO: Gabriele Paoloni <gabriele.paoloni@huawei.com>
:::::: CC: Bjorn Helgaas <helgaas@kernel.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-10-09 17:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-09 17:16 [robh:dt/const 1/7] drivers/of/address.c:244:46: sparse: sparse: incorrect type in argument 1 (different modifiers) kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.