summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMika Kuoppala <mika.kuoppala@intel.com>2015-08-11 16:44:31 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-08-14 17:50:42 +0200
commitca5a0fbd53be86d2bf44769741e02e66feeacc0a (patch)
treeb0b037b44ae6323c8f0cf6e28627803d05fcb784 /drivers
parentdrm/i915: Remove the failed context from the fpriv->context_idr (diff)
downloadlinux-ca5a0fbd53be86d2bf44769741e02e66feeacc0a.tar.xz
linux-ca5a0fbd53be86d2bf44769741e02e66feeacc0a.zip
drm/i915: Contain the WA_REG macro
Prevent leaking the if scoping by containing the WA_REG macro inside its own scope. Reported-by: Arun Siluvery <arun.siluvery@linux.intel.com> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com> Reviewed-by: Dave Gordon <david.s.gordon@intel.com> [danvet: Appease checkpatch.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 1a10358d4c48..6e6b8db996ef 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -780,11 +780,11 @@ static int wa_add(struct drm_i915_private *dev_priv,
return 0;
}
-#define WA_REG(addr, mask, val) { \
+#define WA_REG(addr, mask, val) do { \
const int r = wa_add(dev_priv, (addr), (mask), (val)); \
if (r) \
return r; \
- }
+ } while (0)
#define WA_SET_BIT_MASKED(addr, mask) \
WA_REG(addr, (mask), _MASKED_BIT_ENABLE(mask))