Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1612585

[PATCH 1/2] staging: atomisp: simplify the if condition in atomisp_freq_scaling()

From Daeseok Youn <daeseok.youn@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 1/2] staging: atomisp: simplify the if condition in atomisp_freq_scaling()
Date 2017-03-30 08:30 +0200
Message-ID <tqBKN-2aA-1@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


The condition line in if-statement is needed to be shorthen to
improve readability.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
 drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
index 94bc793..eebfccd 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
@@ -255,14 +255,17 @@ int atomisp_freq_scaling(struct atomisp_device *isp,
 	struct atomisp_freq_scaling_rule curr_rules;
 	int i, ret;
 	unsigned short fps = 0;
+	unsigned short masked_dev = 0;
 
 	if (isp->sw_contex.power_state != ATOM_ISP_POWER_UP) {
 		dev_err(isp->dev, "DFS cannot proceed due to no power.\n");
 		return -EINVAL;
 	}
 
-	if ((isp->pdev->device & ATOMISP_PCI_DEVICE_SOC_MASK) ==
-		ATOMISP_PCI_DEVICE_SOC_CHT && ATOMISP_USE_YUVPP(asd))
+	masked_dev = isp->pdev->device & ATOMISP_PCI_DEVICE_SOC_MASK;
+
+	if (masked_dev == ATOMISP_PCI_DEVICE_SOC_CHT &&
+	    ATOMISP_USE_YUVPP(asd))
 		isp->dfs = &dfs_config_cht_soc;
 
 	if (isp->dfs->lowest_freq == 0 || isp->dfs->max_freq_at_vmin == 0 ||
-- 
1.9.1

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] staging: atomisp: simplify the if condition in  atomisp_freq_scaling() Daeseok Youn <daeseok.youn@gmail.com> - 2017-03-30 08:30 +0200
  Re: [PATCH 1/2] staging: atomisp: simplify the if condition in  atomisp_freq_scaling() Alan Cox <alan@linux.intel.com> - 2017-03-30 13:00 +0200
    Re: [PATCH 1/2] staging: atomisp: simplify the if condition in atomisp_freq_scaling() DaeSeok Youn <daeseok.youn@gmail.com> - 2017-03-30 17:50 +0200

csiph-web