summaryrefslogtreecommitdiff
path: root/src/gallium
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2015-11-09 11:14:56 +0000
committerEmil Velikov <emil.l.velikov@gmail.com>2015-11-20 10:56:17 +0000
commitc31218cdb342482064345d78ada691521c367446 (patch)
treedd759b9abf05f0eccdd7cf894250f376e1b430c4 /src/gallium
parenta8f45e0161c13fbda6f3b846219a3eb1d44b25de (diff)
st/va: trivial cleanup
Drop the temporary variable and fold the two conditional. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Acked-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/state_trackers/va/context.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/gallium/state_trackers/va/context.c b/src/gallium/state_trackers/va/context.c
index 98c4104da4..04ca2f2abc 100644
--- a/src/gallium/state_trackers/va/context.c
+++ b/src/gallium/state_trackers/va/context.c
@@ -102,7 +102,6 @@ PUBLIC VAStatus
VA_DRIVER_INIT_FUNC(VADriverContextP ctx)
{
vlVaDriver *drv;
- int drm_fd;
struct drm_state *drm_info;
if (!ctx)
@@ -126,19 +125,13 @@ VA_DRIVER_INIT_FUNC(VADriverContextP ctx)
case VA_DISPLAY_DRM:
case VA_DISPLAY_DRM_RENDERNODES: {
drm_info = (struct drm_state *) ctx->drm_state;
- if (!drm_info) {
- FREE(drv);
- return VA_STATUS_ERROR_INVALID_PARAMETER;
- }
-
- drm_fd = drm_info->fd;
- if (drm_fd < 0) {
+ if (!drm_info || drm_info->fd < 0) {
FREE(drv);
return VA_STATUS_ERROR_INVALID_PARAMETER;
}
- drv->vscreen = vl_drm_screen_create(drm_fd);
+ drv->vscreen = vl_drm_screen_create(drm_info->fd);
if (!drv->vscreen)
goto error_screen;
}