summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2017-07-31 19:45:27 +0100
committerEmil Velikov <[email protected]>2017-08-02 20:42:21 +0100
commitdf8321370204434f2a7ca7cf29be973e060781ed (patch)
treeb1d72784daa0c2d8c7ceab6cb5a35792d27cdfc4
parent69fa9e91cbd14259ebff605a3617cf3204298f0f (diff)
i965: simplify intel_image_format_lookup()
Drop the local variable and return directly. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/intel_screen.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index e9974a35d98..8ec3e03963f 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -349,16 +349,12 @@ intel_image_warn_if_unaligned(__DRIimage *image, const char *func)
static const struct intel_image_format *
intel_image_format_lookup(int fourcc)
{
- const struct intel_image_format *f = NULL;
-
for (unsigned i = 0; i < ARRAY_SIZE(intel_image_formats); i++) {
- if (intel_image_formats[i].fourcc == fourcc) {
- f = &intel_image_formats[i];
- break;
- }
+ if (intel_image_formats[i].fourcc == fourcc)
+ return &intel_image_formats[i];
}
- return f;
+ return NULL;
}
static boolean intel_lookup_fourcc(int dri_format, int *fourcc)