drivers/gpu/drm/i915/i915_gem_gtt.c:2367: error: 'gtt_entry' may be used uninitialized in this function

From: kbuild test robot
Date: Sun Nov 20 2016 - 00:32:46 EST


Hi Dave,

FYI, the error/warning still remains.

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 77079b133f242d3e3710c9b89ed54458307e54ff
commit: 85d1225ec066b2ef46fbd0ed1bae78ae1f3e6c91 drm/i915: Introduce & use new lightweight SGL iterators
date: 6 months ago
config: x86_64-randconfig-a0-11201122 (attached as .config)
compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
reproduce:
git checkout 85d1225ec066b2ef46fbd0ed1bae78ae1f3e6c91
# save the attached .config to linux build tree
make ARCH=x86_64

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All errors (new ones prefixed by >>):

cc1: warnings being treated as errors
drivers/gpu/drm/i915/i915_gem_gtt.c: In function 'gen8_ggtt_insert_entries':
>> drivers/gpu/drm/i915/i915_gem_gtt.c:2367: error: 'gtt_entry' may be used uninitialized in this function
drivers/gpu/drm/i915/i915_gem_gtt.c: In function 'gen6_ggtt_insert_entries':
drivers/gpu/drm/i915/i915_gem_gtt.c:2442: error: 'gtt_entry' may be used uninitialized in this function

vim +/gtt_entry +2367 drivers/gpu/drm/i915/i915_gem_gtt.c

2361 enum i915_cache_level level, u32 unused)
2362 {
2363 struct drm_i915_private *dev_priv = to_i915(vm->dev);
2364 struct i915_ggtt *ggtt = i915_vm_to_ggtt(vm);
2365 struct sgt_iter sgt_iter;
2366 gen8_pte_t __iomem *gtt_entries;
> 2367 gen8_pte_t gtt_entry;
2368 dma_addr_t addr;
2369 int rpm_atomic_seq;
2370 int i = 0;

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip