[Bug 98281] New: Misleading indentation in drivers/gpu/drm/i915/i915_debugfs.c: In function ‘describe_obj’

bugzilla-daemon at bugzilla.kernel.org bugzilla-daemon at bugzilla.kernel.org
Wed May 13 11:59:36 PDT 2015


https://bugzilla.kernel.org/show_bug.cgi?id=98281

            Bug ID: 98281
           Summary: Misleading indentation in
                    drivers/gpu/drm/i915/i915_debugfs.c: In function
                    ‘describe_obj’
           Product: Drivers
           Version: 2.5
    Kernel Version: 4.0.3
          Hardware: All
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Video(DRI - Intel)
          Assignee: intel-gfx-bugs at lists.freedesktop.org
          Reporter: dmalcolm at redhat.com
                CC: intel-gfx-bugs at lists.freedesktop.org
        Regression: No

In kernel-4.0.3/drivers/gpu/drm/i915/i915_debugfs.c: In function
‘describe_obj’:

   142          list_for_each_entry(vma, &obj->vma_list, vma_link)
   143                  if (vma->pin_count > 0)
   144                          pin_count++;
   145                  seq_printf(m, " (pinned x %d)", pin_count);

the "seq_printf" at line 145 is indented as if guarded within the
"list_for_each_entry" at line 142.

My reading of the code is that it's meant to be after the loop, rather than
within it.  The compiler treats it as after, hence I think this indentation
snafu is benign, if misleading.

Seen via an experimental new gcc warning I'm working on for gcc 6,
-Wmisleading-indentation, using gcc r223098 adding
-Werror=misleading-indentation" to KBUILD_CFLAGS in Makefile, where the
experimental gcc emits this error:

drivers/gpu/drm/i915/i915_debugfs.c: In function ‘describe_obj’:
drivers/gpu/drm/i915/i915_debugfs.c:145:3: error: statement is indented as if
it were guarded by... [-Werror=misleading-indentation]
   seq_printf(m, " (pinned x %d)", pin_count);
   ^
In file included from include/linux/mutex.h:14:0,
                 from include/linux/seq_file.h:7,
                 from drivers/gpu/drm/i915/i915_debugfs.c:29:
include/linux/list.h:447:2: note: ...this ‘for’ clause, but it is not
  for (pos = list_first_entry(head, typeof(*pos), member); \
  ^
drivers/gpu/drm/i915/i915_debugfs.c:142:2: note: in expansion of macro
‘list_for_each_entry’
  list_for_each_entry(vma, &obj->vma_list, vma_link)
  ^

Hope this is constructive

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.


More information about the intel-gfx-bugs mailing list