[drm-intel:drm-intel-next-queued 255/259] drivers/gpu/drm/i915/i915_gem_gtt.c:366:36: sparse: dereference of noderef expression

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ben,

FYI, there are new sparse warnings show up in

tree:   git://people.freedesktop.org/~danvet/drm-intel.git drm-intel-next-queued
head:   afef67fbc09aec8508c88aac1931661a36e91958
commit: a1e0e54668f41badfaf5e49cae9fc10b79635b25 [255/259] drm/i915: Stop using AGP layer for GEN6+

+ drivers/gpu/drm/i915/i915_gem_gtt.c:366:36: sparse: dereference of noderef expression

vim +366 drivers/gpu/drm/i915/i915_gem_gtt.c

a1e0e546 Ben Widawsky 2012-11-04  350  {
a1e0e546 Ben Widawsky 2012-11-04  351  	struct drm_device *dev = obj->base.dev;
a1e0e546 Ben Widawsky 2012-11-04  352  	struct drm_i915_private *dev_priv = dev->dev_private;
a1e0e546 Ben Widawsky 2012-11-04  353  	struct sg_table *st = obj->pages;
a1e0e546 Ben Widawsky 2012-11-04  354  	struct scatterlist *sg = st->sgl;
a1e0e546 Ben Widawsky 2012-11-04  355  	const int first_entry = obj->gtt_space->start >> PAGE_SHIFT;
a1e0e546 Ben Widawsky 2012-11-04  356  	const int max_entries = dev_priv->mm.gtt->gtt_total_entries - first_entry;
a1e0e546 Ben Widawsky 2012-11-04  357  	gtt_pte_t __iomem *gtt_entries = dev_priv->mm.gtt->gtt + first_entry;
a1e0e546 Ben Widawsky 2012-11-04  358  	int unused, i = 0;
a1e0e546 Ben Widawsky 2012-11-04  359  	unsigned int len, m = 0;
a1e0e546 Ben Widawsky 2012-11-04  360  	dma_addr_t addr;
a1e0e546 Ben Widawsky 2012-11-04  361  
a1e0e546 Ben Widawsky 2012-11-04  362  	for_each_sg(st->sgl, sg, st->nents, unused) {
a1e0e546 Ben Widawsky 2012-11-04  363  		len = sg_dma_len(sg) >> PAGE_SHIFT;
a1e0e546 Ben Widawsky 2012-11-04  364  		for (m = 0; m < len; m++) {
a1e0e546 Ben Widawsky 2012-11-04  365  			addr = sg_dma_address(sg) + (m << PAGE_SHIFT);
a1e0e546 Ben Widawsky 2012-11-04 @366  			gtt_entries[i] = pte_encode(dev, addr, level);
a1e0e546 Ben Widawsky 2012-11-04  367  			i++;
a1e0e546 Ben Widawsky 2012-11-04  368  		}
a1e0e546 Ben Widawsky 2012-11-04  369  	}
a1e0e546 Ben Widawsky 2012-11-04  370  
a1e0e546 Ben Widawsky 2012-11-04  371  	BUG_ON(i > max_entries);
a1e0e546 Ben Widawsky 2012-11-04  372  	BUG_ON(i != obj->base.size / PAGE_SIZE);
a1e0e546 Ben Widawsky 2012-11-04  373  
a1e0e546 Ben Widawsky 2012-11-04  374  	/* XXX: This serves as a posting read to make sure that the PTE has

---
0-DAY kernel build testing backend         Open Source Technology Center
Fengguang Wu, Yuanhan Liu                              Intel Corporation
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux