From patchwork Wed Apr 10 10:42:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 2420631 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 35EAADF2E5 for ; Wed, 10 Apr 2013 10:44:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936574Ab3DJKoa (ORCPT ); Wed, 10 Apr 2013 06:44:30 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:23261 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936557Ab3DJKo3 (ORCPT ); Wed, 10 Apr 2013 06:44:29 -0400 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0ML100H1UCI1JLG0@mailout2.samsung.com>; Wed, 10 Apr 2013 19:44:28 +0900 (KST) X-AuditID: cbfee61a-b7fa86d0000045ae-42-5165428cb275 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id BC.9F.17838.C8245615; Wed, 10 Apr 2013 19:44:28 +0900 (KST) Received: from amdc1344.digital.local ([106.116.147.32]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0ML1001RKCFDPL00@mmp1.samsung.com>; Wed, 10 Apr 2013 19:44:28 +0900 (KST) From: Sylwester Nawrocki To: linux-media@vger.kernel.org Cc: kyungmin.park@samsung.com, linux-samsung-soc@vger.kernel.org, shaik.samsung@gmail.com, arun.kk@samsung.com, Sylwester Nawrocki Subject: [PATCH 6/7] exynos4-is: Remove meaningless test before bit setting Date: Wed, 10 Apr 2013 12:42:41 +0200 Message-id: <1365590562-5747-7-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1365590562-5747-1-git-send-email-s.nawrocki@samsung.com> References: <1365590562-5747-1-git-send-email-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpiluLIzCtJLcpLzFFi42I5/e+xgG6PU2qgwYHnBhYfT91mtTjb9Ibd omfDVlaLGef3MVkcftPOarFu5yR2BzaPnbPusnv0bVnF6PF5k1wAcxSXTUpqTmZZapG+XQJX xqRbK5kLDqtUtK7aytrAuEeui5GTQ0LAROLsg5eMELaYxIV769m6GLk4hAQWMUr8fdnECOF0 MEn0PfnCDFLFJmAo0Xu0D6xDREBe4knvDTYQm1lgPqNEyx4OEFtYwFti5uTf7CA2i4CqxIk7 Z1hAbF4BV4kPj1cxdTFyAG1TkJgzyQbE5BRwk2i4FQFiCgFVfN+lNoGRdwEjwypG0dSC5ILi pPRcQ73ixNzi0rx0veT83E2M4JB5JrWDcWWDxSFGAQ5GJR5eD/2UQCHWxLLiytxDjBIczEoi vBZaqYFCvCmJlVWpRfnxRaU5qcWHGKU5WJTEeQ+0WgcKCaQnlqRmp6YWpBbBZJk4OKUaGCs5 FX/k+t/+ozzhfIXESk8v3n0sH24EmhxjvzlnSuvXp64FVkV/dy9e+yhp+o0XGl1CHS4Sm9aG pnHLs9/dMK9trXmMjtEZt79/gvuqn91/Faz31GqS/rbS2CuzDV61PziiHBcfy71j98sbNw/3 Ln8Xkz+/KNj13qLTbpuPGddIKivq7Lg877ISS3FGoqEWc1FxIgAMrNorFQIAAA== Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org There is no need to check same bit before setting it, since we always end up with a bit set. Remove some of the tests and make set unconditional, in every place where all that needs to be done is just setting a bit. Signed-off-by: Sylwester Nawrocki Signed-off-by: Kyungmin Park --- drivers/media/platform/exynos4-is/fimc-is-param.c | 40 +++++---------------- 1 file changed, 9 insertions(+), 31 deletions(-) diff --git a/drivers/media/platform/exynos4-is/fimc-is-param.c b/drivers/media/platform/exynos4-is/fimc-is-param.c index 254740f..53fe2a2 100644 --- a/drivers/media/platform/exynos4-is/fimc-is-param.c +++ b/drivers/media/platform/exynos4-is/fimc-is-param.c @@ -269,9 +269,7 @@ void __is_set_sensor(struct fimc_is *is, int fps) unsigned int index = is->config_index; struct sensor_param *sensor; struct isp_param *isp; - unsigned long *p_index; - p_index = &is->config[index].p_region_index1; sensor = &is->config[index].sensor; isp = &is->config[index].isp; @@ -286,11 +284,8 @@ void __is_set_sensor(struct fimc_is *is, int fps) isp->otf_input.frametime_max = (u32)1000000 / fps; } - if (!test_bit(PARAM_SENSOR_FRAME_RATE, p_index)) - fimc_is_set_param_bit(is, PARAM_SENSOR_FRAME_RATE); - - if (!test_bit(PARAM_ISP_OTF_INPUT, p_index)) - fimc_is_set_param_bit(is, PARAM_ISP_OTF_INPUT); + fimc_is_set_param_bit(is, PARAM_SENSOR_FRAME_RATE); + fimc_is_set_param_bit(is, PARAM_ISP_OTF_INPUT); } void __is_set_init_isp_aa(struct fimc_is *is) @@ -317,65 +312,54 @@ void __is_set_init_isp_aa(struct fimc_is *is) void __is_set_isp_flash(struct fimc_is *is, u32 cmd, u32 redeye) { unsigned int index = is->config_index; - struct chain_config *cfg = &is->config[index]; - struct isp_param *isp = &cfg->isp; + struct isp_param *isp = &is->config[index].isp; isp->flash.cmd = cmd; isp->flash.redeye = redeye; isp->flash.err = ISP_FLASH_ERROR_NONE; - if (!test_bit(PARAM_ISP_FLASH, &cfg->p_region_index1)) - fimc_is_set_param_bit(is, PARAM_ISP_FLASH); + fimc_is_set_param_bit(is, PARAM_ISP_FLASH); } void __is_set_isp_awb(struct fimc_is *is, u32 cmd, u32 val) { unsigned int index = is->config_index; struct isp_param *isp; - unsigned long *p_index; - p_index = &is->config[index].p_region_index1; isp = &is->config[index].isp; isp->awb.cmd = cmd; isp->awb.illumination = val; isp->awb.err = ISP_AWB_ERROR_NONE; - if (!test_bit(PARAM_ISP_AWB, p_index)) - fimc_is_set_param_bit(is, PARAM_ISP_AWB); + fimc_is_set_param_bit(is, PARAM_ISP_AWB); } void __is_set_isp_effect(struct fimc_is *is, u32 cmd) { unsigned int index = is->config_index; struct isp_param *isp; - unsigned long *p_index; - p_index = &is->config[index].p_region_index1; isp = &is->config[index].isp; isp->effect.cmd = cmd; isp->effect.err = ISP_IMAGE_EFFECT_ERROR_NONE; - if (!test_bit(PARAM_ISP_IMAGE_EFFECT, p_index)) - fimc_is_set_param_bit(is, PARAM_ISP_IMAGE_EFFECT); + fimc_is_set_param_bit(is, PARAM_ISP_IMAGE_EFFECT); } void __is_set_isp_iso(struct fimc_is *is, u32 cmd, u32 val) { unsigned int index = is->config_index; struct isp_param *isp; - unsigned long *p_index; - p_index = &is->config[index].p_region_index1; isp = &is->config[index].isp; isp->iso.cmd = cmd; isp->iso.value = val; isp->iso.err = ISP_ISO_ERROR_NONE; - if (!test_bit(PARAM_ISP_ISO, p_index)) - fimc_is_set_param_bit(is, PARAM_ISP_ISO); + fimc_is_set_param_bit(is, PARAM_ISP_ISO); } void __is_set_isp_adjust(struct fimc_is *is, u32 cmd, u32 val) @@ -464,32 +448,26 @@ void __is_set_isp_afc(struct fimc_is *is, u32 cmd, u32 val) { unsigned int index = is->config_index; struct isp_param *isp; - unsigned long *p_index; - p_index = &is->config[index].p_region_index1; isp = &is->config[index].isp; isp->afc.cmd = cmd; isp->afc.manual = val; isp->afc.err = ISP_AFC_ERROR_NONE; - if (!test_bit(PARAM_ISP_AFC, p_index)) - fimc_is_set_param_bit(is, PARAM_ISP_AFC); + fimc_is_set_param_bit(is, PARAM_ISP_AFC); } void __is_set_drc_control(struct fimc_is *is, u32 val) { unsigned int index = is->config_index; struct drc_param *drc; - unsigned long *p_index; - p_index = &is->config[index].p_region_index1; drc = &is->config[index].drc; drc->control.bypass = val; - if (!test_bit(PARAM_DRC_CONTROL, p_index)) - fimc_is_set_param_bit(is, PARAM_DRC_CONTROL); + fimc_is_set_param_bit(is, PARAM_DRC_CONTROL); } void __is_set_fd_control(struct fimc_is *is, u32 val)