MLK-17703-4: drm: imx: dcss: return the hdr10 table at once
authorLaurentiu Palcu <laurentiu.palcu@nxp.com>
Fri, 23 Mar 2018 12:46:48 +0000 (07:46 -0500)
committerHaibo Chen <haibo.chen@nxp.com>
Thu, 12 Apr 2018 10:45:59 +0000 (18:45 +0800)
Don't go through the rest of the list if we found our table. Just return it
immediately.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
drivers/gpu/imx/dcss/dcss-hdr10.c

index 2c833a7..6f2a9ff 100644 (file)
@@ -357,16 +357,15 @@ static u32 *dcss_hdr10_find_tbl(u64 desc, struct list_head *head)
 {
        struct list_head *node;
        struct dcss_hdr10_tbl_node *tbl_node;
-       u32 *tbl = NULL;
 
        list_for_each(node, head) {
                tbl_node = container_of(node, struct dcss_hdr10_tbl_node, node);
 
                if ((tbl_node->tbl_descriptor & desc) == desc)
-                       tbl = tbl_node->tbl_data;
+                       return tbl_node->tbl_data;
        }
 
-       return tbl;
+       return NULL;
 }
 
 static int dcss_hdr10_get_tbls(struct dcss_hdr10_priv *hdr10, bool input,