amvecm: dnlp coverity fix
authorMingLiang Dong <mingliang.dong@amlogic.com>
Mon, 6 Aug 2018 03:30:52 +0000 (11:30 +0800)
committerYixun Lan <yixun.lan@amlogic.com>
Tue, 7 Aug 2018 04:30:30 +0000 (21:30 -0700)
PD#171026: amvecm: dnlp coverity fix

1. fix dnlp coverity
2. add kernel auto make dnlp_alg.ko

Change-Id: Idafc02e95655a9970ad778820b33c044e87bb767
Signed-off-by: MingLiang Dong <mingliang.dong@amlogic.com>
drivers/amlogic/media/algorithm/Kconfig
drivers/amlogic/media/algorithm/Makefile
drivers/amlogic/media/enhancement/amvecm/amvecm.c
drivers/amlogic/media/enhancement/amvecm/dnlp_algorithm/Makefile [deleted file]
drivers/amlogic/media/enhancement/amvecm/dnlp_algorithm/dnlp_alg.h
drivers/amlogic/media/enhancement/amvecm/dnlp_cal.c

index f28ecad1086f6c208534f19db2a7971649c9c961..ccf054daa66de9f64b107085a99d77a05a1ead86 100644 (file)
@@ -16,6 +16,7 @@ config AMLOGIC_MEDIA_ALGORITHM
 
 if AMLOGIC_MEDIA_ALGORITHM
 #source "drivers/amlogic/media/algorithm/ldim/Kconfig"
+#source "drivers/amlogic/media/algorithm/dnlp/Kconfig"
 endif
 
 endmenu
index 9cdffe628c6cb7ca45d31f30cc9823be3257bc48..310e9440ec41fcd747cefc80de42796aa105c9da 100644 (file)
@@ -1 +1,2 @@
 obj-$(CONFIG_AMLOGIC_MEDIA_ALGORITHM) = ldim/
+obj-$(CONFIG_AMLOGIC_MEDIA_ALGORITHM) = dnlp/
\ No newline at end of file
index ec26519fbe3f7989857caf4bd559f02f5bbeb099..765f2f5c1803d2683390fdd166af1fc7f95e6101 100644 (file)
@@ -1338,7 +1338,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
 
        if (!dnlp_insmod_ok) {
                pr_info("dnlp insmod fial\n");
-               return -EINVAL;
+               goto free_buf;
        }
 
        if (!strcmp(parm[0], "r")) {/*read param*/
@@ -1368,11 +1368,9 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
                for (i = 0; dnlp_parse_cmd[i].value; i++) {
                        if (!strcmp(parm[1],
                                        dnlp_parse_cmd[i].parse_string)) {
-                               if (kstrtoul(parm[2], 10, &val) < 0) {
-                                       kfree(buf_orig);
-                                       kfree(stemp);
-                                       return -EINVAL;
-                               }
+                               if (kstrtoul(parm[2], 10, &val) < 0)
+                                       goto free_buf;
+
                                *(dnlp_parse_cmd[i].value) = val;
                                pr_amvecm_dbg(" %s: %d\n",
                                        dnlp_parse_cmd[i].parse_string,
@@ -1385,20 +1383,16 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
                if (!strcmp(parm[1], "scurv_low")) {
                        if (parm[2] == NULL) {
                                pr_info("error cmd\n");
-                               kfree(buf_orig);
-                               kfree(stemp);
-                               return -EINVAL;
+                               goto free_buf;
                        } else if (!strcmp(parm[2], "all")) {
                                for (i = 0; i < 65; i++)
                                        d_convert_str(dnlp_scurv_low_copy[i],
                                                i, stemp, 4);
                                        pr_info("%s\n", stemp);
                        } else {
-                               if (kstrtoul(parm[2], 10, &val) < 0) {
-                                       kfree(stemp);
-                                       kfree(buf_orig);
-                                       return -EINVAL;
-                               }
+                               if (kstrtoul(parm[2], 10, &val) < 0)
+                                       goto free_buf;
+
                                if ((val > 64) || (val < 0))
                                        pr_info("error cmd\n");
                                else
@@ -1408,20 +1402,16 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
                } else if (!strcmp(parm[1], "scurv_mid1")) {
                        if (parm[2] == NULL) {
                                pr_info("error cmd\n");
-                               kfree(buf_orig);
-                               kfree(stemp);
-                               return -EINVAL;
+                               goto free_buf;
                        } else if (!strcmp(parm[2], "all")) {
                                for (i = 0; i < 65; i++)
                                        d_convert_str(dnlp_scurv_mid1_copy[i],
                                                i, stemp, 4);
                                        pr_info("%s\n", stemp);
                        } else {
-                               if (kstrtoul(parm[2], 10, &val) < 0) {
-                                       kfree(stemp);
-                                       kfree(buf_orig);
-                                       return -EINVAL;
-                               }
+                               if (kstrtoul(parm[2], 10, &val) < 0)
+                                       goto free_buf;
+
                                if ((val > 64) || (val < 0))
                                        pr_info("error cmd\n");
                                else
@@ -1431,20 +1421,16 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
                } else if (!strcmp(parm[1], "scu v_mid2")) {
                        if (parm[2] == NULL) {
                                pr_info("error cmd\n");
-                               kfree(stemp);
-                               kfree(buf_orig);
-                               return -EINVAL;
+                               goto free_buf;
                        } else if (!strcmp(parm[2], "all")) {
                                for (i = 0; i < 65; i++)
                                        d_convert_str(dnlp_scurv_mid2_copy[i],
                                                i, stemp, 4);
                                        pr_info("%s\n", stemp);
                        } else {
-                               if (kstrtoul(parm[2], 10, &val) < 0) {
-                                       kfree(stemp);
-                                       kfree(buf_orig);
-                                       return -EINVAL;
-                               }
+                               if (kstrtoul(parm[2], 10, &val) < 0)
+                                       goto free_buf;
+
                                if ((val > 64) || (val < 0))
                                        pr_info("error cmd\n");
                                else
@@ -1454,20 +1440,16 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
                } else if (!strcmp(parm[1], "scurv_hgh1")) {
                        if (parm[2] == NULL) {
                                pr_info("error cmd\n");
-                               kfree(stemp);
-                               kfree(buf_orig);
-                               return -EINVAL;
+                               goto free_buf;
                        } else if (!strcmp(parm[2], "all")) {
                                for (i = 0; i < 65; i++)
                                        d_convert_str(dnlp_scurv_hgh1_copy[i],
                                                i, stemp, 4);
                                        pr_info("%s\n", stemp);
                        } else {
-                               if (kstrtoul(parm[2], 10, &val) < 0) {
-                                       kfree(stemp);
-                                       kfree(buf_orig);
-                                       return -EINVAL;
-                               }
+                               if (kstrtoul(parm[2], 10, &val) < 0)
+                                       goto free_buf;
+
                                if ((val > 64) || (val < 0))
                                        pr_info("error cmd\n");
                                else
@@ -1477,20 +1459,16 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
                } else if (!strcmp(parm[1], "scurv_hgh2")) {
                        if (parm[2] == NULL) {
                                pr_info("error cmd\n");
-                               kfree(stemp);
-                               kfree(buf_orig);
-                               return -EINVAL;
+                               goto free_buf;
                        } else if (!strcmp(parm[2], "all")) {
                                for (i = 0; i < 65; i++)
                                        d_convert_str(dnlp_scurv_hgh2_copy[i],
                                                i, stemp, 4);
                                        pr_info("%s\n", stemp);
                        } else {
-                               if (kstrtoul(parm[2], 10, &val) < 0) {
-                                       kfree(stemp);
-                                       kfree(buf_orig);
-                                       return -EINVAL;
-                               }
+                               if (kstrtoul(parm[2], 10, &val) < 0)
+                                       goto free_buf;
+
                                if ((val > 64) || (val < 0))
                                        pr_info("error cmd\n");
                                else
@@ -1500,20 +1478,16 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
                } else if (!strcmp(parm[1], "gain_var_lut49")) {
                        if (parm[2] == NULL) {
                                pr_info("error cmd\n");
-                               kfree(stemp);
-                               kfree(buf_orig);
-                               return -EINVAL;
+                               goto free_buf;
                        } else if (!strcmp(parm[2], "all")) {
                                for (i = 0; i < 49; i++)
                                        d_convert_str(gain_var_lut49_copy[i],
                                                i, stemp, 4);
                                        pr_info("%s\n", stemp);
                        } else {
-                               if (kstrtoul(parm[2], 10, &val) < 0) {
-                                       kfree(stemp);
-                                       kfree(buf_orig);
-                                       return -EINVAL;
-                               }
+                               if (kstrtoul(parm[2], 10, &val) < 0)
+                                       goto free_buf;
+
                                if ((val > 48) || (val < 0))
                                        pr_info("error cmd\n");
                                else
@@ -1523,20 +1497,16 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
                } else if (!strcmp(parm[1], "wext_gain")) {
                        if (parm[2] == NULL) {
                                pr_info("error cmd\n");
-                               kfree(stemp);
-                               kfree(buf_orig);
-                               return -EINVAL;
+                               goto free_buf;
                        } else if (!strcmp(parm[2], "all")) {
                                for (i = 0; i < 48; i++)
                                        d_convert_str(wext_gain_copy[i],
                                                i, stemp, 4);
                                        pr_info("%s\n", stemp);
                        } else {
-                               if (kstrtoul(parm[2], 10, &val) < 0) {
-                                       kfree(stemp);
-                                       kfree(buf_orig);
-                                       return -EINVAL;
-                               }
+                               if (kstrtoul(parm[2], 10, &val) < 0)
+                                       goto free_buf;
+
                                if ((val > 47) || (val < 0))
                                        pr_info("error cmd\n");
                                else
@@ -1546,9 +1516,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
                        /*read only curve*/
                        if (parm[2] == NULL) {
                                pr_info("error cmd\n");
-                               kfree(stemp);
-                               kfree(buf_orig);
-                               return -EINVAL;
+                               goto free_buf;
                        } else if (!strcmp(parm[2], "all")) {
                                for (i = 0; i < 65; i++)
                                        d_convert_str(ve_dnlp_tgt_copy[i],
@@ -1560,9 +1528,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
                        /*read only curve*/
                        if (parm[2] == NULL) {
                                pr_info("error cmd\n");
-                               kfree(stemp);
-                               kfree(buf_orig);
-                               return -EINVAL;
+                               goto free_buf;
                        } else if (!strcmp(parm[2], "all")) {
                                for (i = 0; i < 65; i++)
                                        d_convert_str(GmScurve_copy[i],
@@ -1574,9 +1540,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
                        /*read only curve*/
                        if (parm[2] == NULL) {
                                pr_info("error cmd\n");
-                               kfree(stemp);
-                               kfree(buf_orig);
-                               return -EINVAL;
+                               goto free_buf;
                        } else if (!strcmp(parm[2], "all")) {
                                for (i = 0; i < 65; i++)
                                        d_convert_str(clash_curve_copy[i],
@@ -1588,9 +1552,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
                        /*read only curve*/
                        if (parm[2] == NULL) {
                                pr_info("error cmd\n");
-                               kfree(stemp);
-                               kfree(buf_orig);
-                               return -EINVAL;
+                               goto free_buf;
                        } else if (!strcmp(parm[2], "all")) {
                                for (i = 0; i < 65; i++)
                                        d_convert_str(clsh_scvbld_copy[i],
@@ -1602,9 +1564,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
                        /*read only curve*/
                        if (parm[2] == NULL) {
                                pr_info("error cmd\n");
-                               kfree(stemp);
-                               kfree(buf_orig);
-                               return -EINVAL;
+                               goto free_buf;
                        } else if (!strcmp(parm[2], "all")) {
                                for (i = 0; i < 65; i++)
                                        d_convert_str(blkwht_ebld_copy[i],
@@ -1616,9 +1576,7 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
                        /*read only curve*/
                        if (parm[2] == NULL) {
                                pr_info("error cmd\n");
-                               kfree(stemp);
-                               kfree(buf_orig);
-                               return -EINVAL;
+                               goto free_buf;
                        } else if (!strcmp(parm[2], "all")) {
                                for (i = 0; i < 64; i++)
                                        d_convert_str(
@@ -1632,25 +1590,19 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
                if (!strcmp(parm[1], "scurv_low")) {
                        if (parm[2] == NULL) {
                                pr_info("error cmd\n");
-                               kfree(stemp);
-                               kfree(buf_orig);
-                               return -EINVAL;
+                               goto free_buf;
                        } else if (!strcmp(parm[2], "all")) {
                                str_sapr_to_d(parm[3], curve_val, 5);
                                for (i = 0; i < 65; i++)
                                        dnlp_scurv_low_copy[i] = curve_val[i];
                        } else {
-                               if (kstrtoul(parm[2], 10, &val) < 0) {
-                                       kfree(stemp);
-                                       kfree(buf_orig);
-                                       return -EINVAL;
-                               }
+                               if (kstrtoul(parm[2], 10, &val) < 0)
+                                       goto free_buf;
+
                                num = val;
-                               if (kstrtoul(parm[3], 10, &val) < 0) {
-                                       kfree(buf_orig);
-                                       kfree(stemp);
-                                       return -EINVAL;
-                               }
+                               if (kstrtoul(parm[3], 10, &val) < 0)
+                                       goto free_buf;
+
                                if (num > 64)
                                        pr_info("error cmd\n");
                                else
@@ -1659,25 +1611,19 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
                } else if (!strcmp(parm[1], "scurv_mid1")) {
                        if (parm[2] == NULL) {
                                pr_info("error cmd\n");
-                               kfree(stemp);
-                               kfree(buf_orig);
-                               return -EINVAL;
+                               goto free_buf;
                        } else if (!strcmp(parm[2], "all")) {
                                str_sapr_to_d(parm[3], curve_val, 5);
                                for (i = 0; i < 65; i++)
                                        dnlp_scurv_mid1_copy[i] = curve_val[i];
                        } else {
-                               if (kstrtoul(parm[2], 10, &val) < 0) {
-                                       kfree(stemp);
-                                       kfree(buf_orig);
-                                       return -EINVAL;
-                               }
+                               if (kstrtoul(parm[2], 10, &val) < 0)
+                                       goto free_buf;
+
                                num = val;
-                               if (kstrtoul(parm[3], 10, &val) < 0) {
-                                       kfree(buf_orig);
-                                       kfree(stemp);
-                                       return -EINVAL;
-                               }
+                               if (kstrtoul(parm[3], 10, &val) < 0)
+                                       goto free_buf;
+
                                if (num > 64)
                                        pr_info("error cmd\n");
                                else
@@ -1686,25 +1632,19 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
                } else if (!strcmp(parm[1], "scurv_mid2")) {
                        if (parm[2] == NULL) {
                                pr_info("error cmd\n");
-                               kfree(stemp);
-                               kfree(buf_orig);
-                               return -EINVAL;
+                               goto free_buf;
                        } else if (!strcmp(parm[2], "all")) {
                                str_sapr_to_d(parm[3], curve_val, 5);
                                for (i = 0; i < 65; i++)
                                        dnlp_scurv_mid2_copy[i] = curve_val[i];
                        } else {
-                               if (kstrtoul(parm[2], 10, &val) < 0) {
-                                       kfree(buf_orig);
-                                       kfree(stemp);
-                                       return -EINVAL;
-                               }
+                               if (kstrtoul(parm[2], 10, &val) < 0)
+                                       goto free_buf;
+
                                num = val;
-                               if (kstrtoul(parm[3], 10, &val) < 0) {
-                                       kfree(stemp);
-                                       kfree(buf_orig);
-                                       return -EINVAL;
-                               }
+                               if (kstrtoul(parm[3], 10, &val) < 0)
+                                       goto free_buf;
+
                                if (num > 64)
                                        pr_info("error cmd\n");
                                else
@@ -1713,25 +1653,19 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
                } else if (!strcmp(parm[1], "scurv_hgh1")) {
                        if (parm[2] == NULL) {
                                pr_info("error cmd\n");
-                               kfree(stemp);
-                               kfree(buf_orig);
-                               return -EINVAL;
+                               goto free_buf;
                        } else if (!strcmp(parm[2], "all")) {
                                str_sapr_to_d(parm[3], curve_val, 5);
                                for (i = 0; i < 65; i++)
                                        dnlp_scurv_hgh1_copy[i] = curve_val[i];
                        } else {
-                               if (kstrtoul(parm[2], 10, &val) < 0) {
-                                       kfree(stemp);
-                                       kfree(buf_orig);
-                                       return -EINVAL;
-                               }
+                               if (kstrtoul(parm[2], 10, &val) < 0)
+                                       goto free_buf;
+
                                num = val;
-                               if (kstrtoul(parm[3], 10, &val) < 0) {
-                                       kfree(stemp);
-                                       kfree(buf_orig);
-                                       return -EINVAL;
-                               }
+                               if (kstrtoul(parm[3], 10, &val) < 0)
+                                       goto free_buf;
+
                                if (num > 64)
                                        pr_info("error cmd\n");
                                else
@@ -1740,25 +1674,19 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
                } else if (!strcmp(parm[1], "scurv_hgh2")) {
                        if (parm[2] == NULL) {
                                pr_info("error cmd\n");
-                               kfree(stemp);
-                               kfree(buf_orig);
-                               return -EINVAL;
+                               goto free_buf;
                        } else if (!strcmp(parm[2], "all")) {
                                str_sapr_to_d(parm[3], curve_val, 5);
                                for (i = 0; i < 65; i++)
                                        dnlp_scurv_hgh2_copy[i] = curve_val[i];
                        } else {
-                               if (kstrtoul(parm[2], 10, &val) < 0) {
-                                       kfree(stemp);
-                                       kfree(buf_orig);
-                                       return -EINVAL;
-                               }
+                               if (kstrtoul(parm[2], 10, &val) < 0)
+                                       goto free_buf;
+
                                num = val;
-                               if (kstrtoul(parm[3], 10, &val) < 0) {
-                                       kfree(stemp);
-                                       kfree(buf_orig);
-                                       return -EINVAL;
-                               }
+                               if (kstrtoul(parm[3], 10, &val) < 0)
+                                       goto free_buf;
+
                                if (num > 64)
                                        pr_info("error cmd\n");
                                else
@@ -1767,25 +1695,19 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
                } else if (!strcmp(parm[1], "gain_var_lut49")) {
                        if (parm[2] == NULL) {
                                pr_info("error cmd\n");
-                               kfree(stemp);
-                               kfree(buf_orig);
-                               return -EINVAL;
+                               goto free_buf;
                        } else if (!strcmp(parm[2], "all")) {
                                str_sapr_to_d(parm[3], curve_val, 5);
                                for (i = 0; i < 49; i++)
                                        gain_var_lut49_copy[i] = curve_val[i];
                        } else {
-                               if (kstrtoul(parm[2], 10, &val) < 0) {
-                                       kfree(stemp);
-                                       kfree(buf_orig);
-                                       return -EINVAL;
-                               }
+                               if (kstrtoul(parm[2], 10, &val) < 0)
+                                       goto free_buf;
+
                                num = val;
-                               if (kstrtoul(parm[3], 10, &val) < 0) {
-                                       kfree(stemp);
-                                       kfree(buf_orig);
-                                       return -EINVAL;
-                               }
+                               if (kstrtoul(parm[3], 10, &val) < 0)
+                                       goto free_buf;
+
                                if (num > 48)
                                        pr_info("error cmd\n");
                                else
@@ -1794,25 +1716,19 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
                } else if (!strcmp(parm[1], "wext_gain")) {
                        if (parm[2] == NULL) {
                                pr_info("error cmd\n");
-                               kfree(stemp);
-                               kfree(buf_orig);
-                               return -EINVAL;
+                               goto free_buf;
                        } else if (!strcmp(parm[2], "all")) {
                                str_sapr_to_d(parm[3], curve_val, 5);
                                for (i = 0; i < 48; i++)
                                        wext_gain_copy[i] = curve_val[i];
                        } else {
-                               if (kstrtoul(parm[2], 10, &val) < 0) {
-                                       kfree(stemp);
-                                       kfree(buf_orig);
-                                       return -EINVAL;
-                               }
+                               if (kstrtoul(parm[2], 10, &val) < 0)
+                                       goto free_buf;
+
                                num = val;
-                               if (kstrtoul(parm[3], 10, &val) < 0) {
-                                       kfree(stemp);
-                                       kfree(buf_orig);
-                                       return -EINVAL;
-                               }
+                               if (kstrtoul(parm[3], 10, &val) < 0)
+                                       goto free_buf;
+
                                if (num > 47)
                                        pr_info("error cmd\n");
                                else
@@ -1835,16 +1751,21 @@ static ssize_t amvecm_dnlp_debug_store(struct class *cla,
                else
                        pr_info("error cmd\n");
        } else if (!strcmp(parm[0], "dnlp_print")) {
-               if (kstrtoul(parm[1], 16, &val) < 0) {
-                       kfree(buf_orig);
-                       return -EINVAL;
-               }
+               if (kstrtoul(parm[1], 16, &val) < 0)
+                       goto free_buf;
+
                *dnlp_printk_copy = val;
                pr_info("dnlp_print = %x\n", *dnlp_printk_copy);
        }
+
        kfree(buf_orig);
        kfree(stemp);
        return count;
+
+free_buf:
+       kfree(buf_orig);
+       kfree(stemp);
+       return -EINVAL;
 }
 
 static ssize_t amvecm_brightness_show(struct class *cla,
@@ -3498,11 +3419,14 @@ static ssize_t amvecm_pq_user_store(struct class *cla,
        return count;
 }
 
+static const char *dnlp_insmod_debug_usage_str = {
+       "usage: echo 1 > /sys/class/amvecm/dnlp_insmod\n"
+};
+
 static ssize_t amvecm_dnlp_insmod_show(struct class *cla,
                        struct class_attribute *attr, char *buf)
 {
-       pr_info("usage: echo 1 > /sys/class/amvecm/dnlp_insmod\n");
-       return 0;
+       return sprintf(buf, "%s\n", dnlp_insmod_debug_usage_str);
 }
 
 static ssize_t amvecm_dnlp_insmod_store(struct class *cla,
diff --git a/drivers/amlogic/media/enhancement/amvecm/dnlp_algorithm/Makefile b/drivers/amlogic/media/enhancement/amvecm/dnlp_algorithm/Makefile
deleted file mode 100644 (file)
index 156a98c..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-CONFIG_AMLOGIC_DNLP_ALG=m
-obj-$(CONFIG_AMLOGIC_DNLP_ALG) += dnlp_alg.o
-
-dnlp-objs = dnlp_alg.o
-
-TARGET_PRODUCT=t962x_r311
-KERNEL_ARCH=arm64
-CROSS_COMPILE=aarch64-linux-gnu-
-PRODUCT_OUT=./../../../../../../../out/target/product/$(TARGET_PRODUCT)
-TARGET_PATCH=$(shell pwd)
-
-ccflags-y  += -Idrivers/amlogic/media/enhancement/amvecm/
-
-all:
-       rm -rf *.o .*.o.d *.order *.symvers *.mod.* .*.o.cmd .*.ko.cmd *.tmp_versions *.ko
-       make -C $(PRODUCT_OUT)/obj/KERNEL_OBJ M=$(TARGET_PATCH) ARCH=$(KERNEL_ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules
-       rm -rf *.o .*.o.d *.order *.symvers *.mod.* .*.o.cmd .*.ko.cmd *.tmp_versions/
index aa5d3373d2f1ef9f906311fe53671bf07180b806..4b9dd616573bad1fde0e0651126233a51f9b4a46 100644 (file)
@@ -62,49 +62,6 @@ struct param_for_dnlp_s {
        unsigned int dnlp_mtdrate_adp_en;
 };
 
-#if 0
-struct dnlp_alg_input_param_s {
-       unsigned int pre_1_gamma[65];
-       unsigned int pre_0_gamma[65];
-       unsigned int nTstCnt;
-       unsigned int ve_dnlp_luma_sum;
-       int RBASE;
-       unsigned int ve_dnlp_luma_sum;
-       bool menu_chg_en;
-};
-
-struct dnlp_alg_output_param_s {
-       unsigned char ve_dnlp_tgt[65];
-};
-
-struct dnlp_debug_ro_param_s {
-       int ro_luma_avg4;
-       int ro_var_d8;
-       int ro_scurv_gain;
-       int ro_blk_wht_ext0;
-       int ro_blk_wht_ext1;
-       int ro_dnlp_brightness;
-       int GmScurve[65];
-       int clash_curve[65];
-       int clsh_scvbld[65];
-       int blkwht_ebld[65];
-};
-
-struct dnlp_debug_rw_param_s {
-       int dnlp_scurv_low[65];
-       int dnlp_scurv_mid1[65];
-       int dnlp_scurv_mid2[65];
-       int dnlp_scurv_hgh1[65];
-       int dnlp_scurv_hgh2[65];
-       int gain_var_lut49[49];
-       int wext_gain[48];
-};
-
-struct dnlp_debug_param_s {
-       struct dnlp_debug_ro_param_s ro_param;
-       struct dnlp_debug_rw_param_s rw_param;
-};
-#endif
 struct dnlp_alg_input_param_s {
        unsigned int *pre_1_gamma;
        unsigned int *pre_0_gamma;
index 7a22a6ca51e93f5a1ac19a6ce0ce78330a61f5e0..f2346d3e1ecf23175c7512c7c1c1ec1c5a6f6b09 100644 (file)
@@ -138,20 +138,6 @@ struct dnlp_parse_cmd_s dnlp_parse_cmd[] = {
        {"", NULL}
 };
 
-#if 0
-#define dnlp_attach(FUNCTION, ARGS...) ({ \
-       void *__r = NULL; \
-       typeof(&FUNCTION) __a = symbol_request(FUNCTION); \
-       if (__a) { \
-               __r = (void *) __a(ARGS); \
-               if (__r == NULL) \
-                       symbol_put(FUNCTION); \
-       } else { \
-               pr_info("dnlp:Unable find symbol\n"); \
-       } \
-       __r; \
-})
-#endif
 void dnlp_alg_param_copy(void)
 {
        dnlp_scurv_low_copy = dnlp_dbg_rw_param->dnlp_scurv_low;
@@ -253,17 +239,6 @@ void dnlp_alg_param_init(void)
        dnlp_alg_param.dnlp_scurv_hgh2_th = 240;
        dnlp_alg_param.dnlp_mtdrate_adp_en = 1;
 
-#if (0)
-       if (dnlp_alg_function == NULL) {
-               if (dnlp_attach(dnlp_alg_init, &dnlp_alg_function)
-                       == NULL)
-                       pr_info("%s: dnlp alg insmod fail\n", __func__);
-               else
-                       dnlp_insmod_ok = 1;
-       } else
-               pr_info("%s: dnlp_alg_function is not NULL\n",
-                       __func__);
-#endif
        if (dnlp_alg_function != NULL) {
                dnlp_alg_function->dnlp_para_set(&dnlp_alg_output,
                        &dnlp_alg_input, &dnlp_dbg_rw_param, &dnlp_dbg_ro_param,