Skip to contentSkip to conversation

drm/i915: mark wait_for_engine() __maybe_unused

PATCH In review Nick Desaulniers 3 participants 3 messages May 21, 2017 – May 23, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: mark wait_for_engine() __maybe_unused

This solves a warning when compiling the driver with Clang, -Werror enabled, and CONFIG_DRM_I915_DEBUG_GEM unset, since Clang warns that:

drivers/gpu/drm/i915/i915_gem.c:3274:12: error: function 'wait_for_engine' is not needed
and will not be emitted [-Werror,-Wunneeded-internal-declaration]
static int wait_for_engine(struct intel_engine_cs *engine, int timeout_ms)

           ^

---
Additionally, it only has one call site. Should I mark it inline, too, while I'm at it?

 drivers/gpu/drm/i915/i915_gem.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem.c +2 -1
index b6ac3df18b58..73b82fb94b0e 100644
@@ -3271,7 +3271,8 @@ static int wait_for_timeline(struct i915_gem_timeline *tl, unsigned int flags)
 	return 0;
 }
 
-static int wait_for_engine(struct intel_engine_cs *engine, int timeout_ms)
+static __maybe_unused int wait_for_engine(
+	struct intel_engine_cs *engine, int timeout_ms)
 {
 	return wait_for(intel_engine_is_idle(engine), timeout_ms);
 }
Signature · 1 line
2.11.0
#1 lore raw

✓ Fi.CI.BAT: success for drm/i915: mark wait_for_engine() __maybe_unused

== Series Details ==

== Series Details ==

Series: drm/i915: mark wait_for_engine() __maybe_unused
URL : https://patchwork.freedesktop.org/series/24778/
State : success

== Summary ==

Series 24778v1 drm/i915: mark wait_for_engine() __maybe_unused
https://patchwork.freedesktop.org/api/1.0/series/24778/revisions/1/mbox/

Test gem_exec_flush:

        Subgroup basic-batch-kernel-default-uc:
                pass       -> FAIL       (fi-snb-2600) fdo#100007
Test kms_cursor_legacy:
        Subgroup basic-busy-flip-before-cursor-atomic:
                pass       -> FAIL       (fi-snb-2600) fdo#100215

fdo#100007 https://bugs.freedesktop.org/show_bug.cgi?id=100007
fdo#100215 https://bugs.freedesktop.org/show_bug.cgi?id=100215

fi-bdw-5557u     total:278  pass:267  dwarn:0   dfail:0   fail:0   skip:11  time:443s
fi-bdw-gvtdvm    total:278  pass:256  dwarn:8   dfail:0   fail:0   skip:14  time:436s
fi-bsw-n3050     total:278  pass:242  dwarn:0   dfail:0   fail:0   skip:36  time:590s
fi-bxt-j4205     total:278  pass:259  dwarn:0   dfail:0   fail:0   skip:19  time:512s
fi-byt-j1900     total:278  pass:254  dwarn:0   dfail:0   fail:0   skip:24  time:492s
fi-byt-n2820     total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28  time:489s
fi-hsw-4770      total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time:425s
fi-hsw-4770r     total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time:409s
fi-ilk-650       total:278  pass:228  dwarn:0   dfail:0   fail:0   skip:50  time:418s
fi-ivb-3520m     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time:494s
fi-ivb-3770      total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time:469s
fi-kbl-7500u     total:278  pass:255  dwarn:5   dfail:0   fail:0   skip:18  time:462s
fi-skl-6260u     total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time:473s
fi-skl-6700hq    total:278  pass:260  dwarn:1   dfail:0   fail:0   skip:17  time:576s
fi-skl-6700k     total:278  pass:256  dwarn:4   dfail:0   fail:0   skip:18  time:467s
fi-skl-6770hq    total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time:495s
fi-skl-gvtdvm    total:278  pass:265  dwarn:0   dfail:0   fail:0   skip:13  time:442s
fi-snb-2520m     total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28  time:543s
fi-snb-2600      total:278  pass:247  dwarn:0   dfail:0   fail:2   skip:29  time:409s

f20cc05633fee08ea2a99cf544524735057592a1 drm-tip: 2017y-05m-22d-09h-11m-14s UTC integration manifest e19d196 drm/i915: mark wait_for_engine() __maybe_unused

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4766/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw
In reply to Nick Desaulniers

Hi,

Quoted 9 lines · Nick Desaulniers

This solves a warning when compiling the driver with Clang, -Werror enabled, and CONFIG_DRM_I915_DEBUG_GEM unset, since Clang warns that:

drivers/gpu/drm/i915/i915_gem.c:3274:12: error: function 'wait_for_engine' is not needed
and will not be emitted [-Werror,-Wunneeded-internal-declaration]
static int wait_for_engine(struct intel_engine_cs *engine, int timeout_ms)

           ^

You have actually uncovered a bug here where the call is not supposed to be optional in the first place. I'll send a different fix and copy you on it.

Regards,

Tvrtko

Quoted 14 lines

---
Additionally, it only has one call site. Should I mark it inline, too, while I'm at it?

 drivers/gpu/drm/i915/i915_gem.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem.c +0 -0
index b6ac3df18b58..73b82fb94b0e 100644

drivers/gpu/drm/i915/i915_gem.c static int wait_for_timeline(struct i915_gem_timeline *tl, unsigned int flags) · line 3278

Quoted 9 lines
drivers/gpu/drm/i915/i915_gem.c +2 -1
@@ -3271,7 +3271,8 @@ static int wait_for_timeline(struct i915_gem_timeline *tl, unsigned int flags)
 	return 0;
 }
 
-static int wait_for_engine(struct intel_engine_cs *engine, int timeout_ms)
+static __maybe_unused int wait_for_engine(
+	struct intel_engine_cs *engine, int timeout_ms)
 {
 	return wait_for(intel_engine_is_idle(engine), timeout_ms);
 }

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel