CC: [email protected] BCC: [email protected] In-Reply-To: <[email protected]> References: <[email protected]> TO: Li Chen <[email protected]> TO: Catalin Marinas <[email protected]> TO: Will Deacon <[email protected]> TO: Rob Herring <[email protected]> TO: Frank Rowand <[email protected]> TO: Andrew Morton <[email protected]> CC: Linux Memory Management List <[email protected]> CC: Li Chen <[email protected]> CC: [email protected] CC: [email protected] CC: [email protected]
Hi Li, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on robh/for-next] [also build test WARNING on arm64/for-next/core arm-perf/for-next/perf linus/master v5.19-rc7 next-20220715] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Li-Chen/add-struct-page-and-Direct-I-O-support-to-reserved-memory/20220711-202957 base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next :::::: branch date: 7 days ago :::::: commit date: 7 days ago config: nios2-randconfig-m031-20220717 (https://download.01.org/0day-ci/archive/20220718/[email protected]/config) compiler: nios2-linux-gcc (GCC) 12.1.0 If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> smatch warnings: drivers/of/of_reserved_mem.c:472 get_reserved_mem_from_dev() error: passing non negative 22 to ERR_PTR vim +472 drivers/of/of_reserved_mem.c 8b66b4b9614f1c7 Li Chen 2022-07-11 448 8b66b4b9614f1c7 Li Chen 2022-07-11 449 /** 8b66b4b9614f1c7 Li Chen 2022-07-11 450 * get_reserved_mem_from_dev() - get reserved_mem from a device node 8b66b4b9614f1c7 Li Chen 2022-07-11 451 * @dev: device pointer 8b66b4b9614f1c7 Li Chen 2022-07-11 452 * 8b66b4b9614f1c7 Li Chen 2022-07-11 453 * This function look for reserved_mem from given device. 8b66b4b9614f1c7 Li Chen 2022-07-11 454 * 8b66b4b9614f1c7 Li Chen 2022-07-11 455 * Returns a reserved_mem pointer, or NULL on error. 8b66b4b9614f1c7 Li Chen 2022-07-11 456 */ 8b66b4b9614f1c7 Li Chen 2022-07-11 457 struct reserved_mem *get_reserved_mem_from_dev(struct device *dev) 8b66b4b9614f1c7 Li Chen 2022-07-11 458 { 8b66b4b9614f1c7 Li Chen 2022-07-11 459 struct device_node *np = dev_of_node(dev); 8b66b4b9614f1c7 Li Chen 2022-07-11 460 struct device_node *rmem_np; 8b66b4b9614f1c7 Li Chen 2022-07-11 461 struct reserved_mem *rmem = NULL; 8b66b4b9614f1c7 Li Chen 2022-07-11 462 8b66b4b9614f1c7 Li Chen 2022-07-11 463 rmem_np = of_parse_phandle(np, "memory-region", 0); 8b66b4b9614f1c7 Li Chen 2022-07-11 464 if (!rmem_np) { 8b66b4b9614f1c7 Li Chen 2022-07-11 465 dev_err(dev, "failed to get memory region node\n"); 8b66b4b9614f1c7 Li Chen 2022-07-11 466 return ERR_PTR(-ENODEV); 8b66b4b9614f1c7 Li Chen 2022-07-11 467 } 8b66b4b9614f1c7 Li Chen 2022-07-11 468 8b66b4b9614f1c7 Li Chen 2022-07-11 469 rmem = of_reserved_mem_lookup(rmem_np); 8b66b4b9614f1c7 Li Chen 2022-07-11 470 if (!rmem) { 8b66b4b9614f1c7 Li Chen 2022-07-11 471 dev_err(dev, "Failed to lookup reserved memory\n"); 8b66b4b9614f1c7 Li Chen 2022-07-11 @472 return ERR_PTR(EINVAL); 8b66b4b9614f1c7 Li Chen 2022-07-11 473 } 8b66b4b9614f1c7 Li Chen 2022-07-11 474 return rmem; 8b66b4b9614f1c7 Li Chen 2022-07-11 475 } 8b66b4b9614f1c7 Li Chen 2022-07-11 476 EXPORT_SYMBOL_GPL(get_reserved_mem_from_dev); 8b66b4b9614f1c7 Li Chen 2022-07-11 477 -- 0-DAY CI Kernel Test Service https://01.org/lkp _______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
