[PATCH 1/1] drm/mm: optimize rb_hole_addr rbtree search in high addr mode
kbuild test robot
lkp at intel.com
Wed Apr 29 23:02:56 UTC 2020
Hi Nirmoy,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on drm-intel/for-linux-next]
[also build test WARNING on drm-exynos/exynos-drm-next tegra-drm/drm/tegra/for-next drm-tip/drm-tip linus/master v5.7-rc3 next-20200429]
[cannot apply to drm/drm-next]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Nirmoy-Das/drm-mm-optimize-rb_hole_addr-rbtree-search-in-high-addr-mode/20200429-154950
base: git://anongit.freedesktop.org/drm-intel for-linux-next
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-191-gc51a0382-dirty
make ARCH=x86_64 allmodconfig
make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp at intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/drm_mm.c:455:24: sparse: sparse: Using plain integer as NULL pointer
vim +455 drivers/gpu/drm/drm_mm.c
431
432 /**
433 * next_hole_high_addr - returns next hole for a DRM_MM_INSERT_HIGH mode request
434 * @entry: previously selected drm_mm_node
435 * @size: size of the a hole needed for the request
436 *
437 * This function will verify whether left subtree of @entry has hole big enough
438 * to fit the requtested size. If so, it will return previous node of @entry or
439 * else it will return parent node of @entry
440 *
441 * It will also skip the complete left subtree if max_hole_size of that subtree
442 * is same as the max_hole_size of the @entry.
443 *
444 * Returns:
445 * previous node of @entry if left subtree of @entry can serve the request or
446 * else return parent of @entry
447 */
448 static struct drm_mm_node *
449 next_hole_high_addr(struct drm_mm_node *entry, u64 size)
450 {
451 struct rb_node *rb_node, *left_rb_node, *parent_rb_node;
452 struct drm_mm_node *left_node;
453
454 if (!entry)
> 455 return false;
456
457 rb_node = &entry->rb_hole_addr;
458 if (rb_node->rb_left) {
459 left_rb_node = rb_node->rb_left;
460 parent_rb_node = rb_parent(rb_node);
461 left_node = rb_entry(left_rb_node,
462 struct drm_mm_node, rb_hole_addr);
463 if ((left_node->max_hole_size < size ||
464 entry->size == entry->max_hole_size) &&
465 parent_rb_node && parent_rb_node->rb_left != rb_node)
466 return rb_hole_addr_to_node(parent_rb_node);
467 }
468
469 return rb_hole_addr_to_node(rb_prev(rb_node));
470 }
471
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
More information about the dri-devel
mailing list