All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fengguang Wu <fengguang.wu@intel.com>
To: Ben Widawsky <ben@bwidawsk.net>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>, dri-devel@lists.freedesktop.org
Subject: [drm-intel:drm-intel-next-queued 255/259] drivers/gpu/drm/i915/i915_gem_gtt.c:366:36: sparse: dereference of noderef expression
Date: Tue, 6 Nov 2012 11:52:16 +0800	[thread overview]
Message-ID: <20121106035215.GA5820@localhost> (raw)
In-Reply-To: <5096f872.uoHjGcDA7T32Ub7S%yuanhan.liu@linux.intel.com>


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

           reply	other threads:[~2012-11-06  3:52 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <5096f872.uoHjGcDA7T32Ub7S%yuanhan.liu@linux.intel.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121106035215.GA5820@localhost \
    --to=fengguang.wu@intel.com \
    --cc=ben@bwidawsk.net \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.