From patchwork Thu Jul 31 17:11:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 4658031 X-Patchwork-Delegate: eduardo.valentin@ti.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7C3B4C0338 for ; Thu, 31 Jul 2014 17:12:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A791320114 for ; Thu, 31 Jul 2014 17:12:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C6176201BB for ; Thu, 31 Jul 2014 17:12:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752449AbaGaRL5 (ORCPT ); Thu, 31 Jul 2014 13:11:57 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:33171 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752829AbaGaRLy (ORCPT ); Thu, 31 Jul 2014 13:11:54 -0400 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N9L00JV76FSHPA0@mailout1.samsung.com>; Fri, 01 Aug 2014 02:11:53 +0900 (KST) X-AuditID: cbfee61b-f79f86d00000144c-35-53da78d84e79 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id EC.2C.05196.8D87AD35; Fri, 01 Aug 2014 02:11:52 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N9L00FYN6ES5750@mmp1.samsung.com>; Fri, 01 Aug 2014 02:11:52 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Eduardo Valentin Cc: Zhang Rui , Amit Daniel Kachhap , Tomasz Figa , "Rafael J. Wysocki" , Kyungmin Park , linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, b.zolnierkie@samsung.com Subject: [PATCH v3 7/8] thermal: exynos: remove redundant pdata checks from exynos_tmu_control() Date: Thu, 31 Jul 2014 19:11:05 +0200 Message-id: <1406826667-2289-8-git-send-email-b.zolnierkie@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1406826667-2289-1-git-send-email-b.zolnierkie@samsung.com> References: <1406826667-2289-1-git-send-email-b.zolnierkie@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrILMWRmVeSWpSXmKPExsVy+t9jAd0bFbeCDR6/NLdouBpisXHGelaL Nft/MlmcbXrDbnF51xw2i8+9RxgtZpzfx2Rx5vQlVosnD/vYLNbPeM3iwOWxeM9LJo8tV9tZ PPq2rGL0OH5jO5PH501yAaxRXDYpqTmZZalF+nYJXBkzD9xlL9gkVHH8k2oD4xn+LkZODgkB E4mFxy8xQdhiEhfurWfrYuTiEBJYxCjx9O4XZgini0niQ/MbRpAqNgEriYntq8BsEQE9iRsv njCBFDELHGeS+Pn7PBtIQlggSeL/ypcsIDaLgKrEzRPTgGwODl4Bd4ndP0MhtilKdD+bAFbO KeAhcaB9BpgtBFTyd9NJ1gmMvAsYGVYxiqYWJBcUJ6XnGukVJ+YWl+al6yXn525iBAfcM+kd jKsaLA4xCnAwKvHwOoTeChZiTSwrrsw9xCjBwawkwutSDhTiTUmsrEotyo8vKs1JLT7EKM3B oiTOe7DVOlBIID2xJDU7NbUgtQgmy8TBKdXAaGiR5/VwncZlSWPzrt2ban84nfmpb/XkYoTn 48WKcR8bv0hdlS/pKPwXemueMhvbJHYRmbrdne8YPcVb31l2WSy8wCpQ/vBVmVHL5T7pxONs qVI3NWYs33pWd42ddu+LX4/s9f2v739SOWNlhOWpRaeMPzrIOQvkce/esVD3zcErJ7m4thSZ KLEUZyQaajEXFScCAPwUy4k0AgAA Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP pdata->reference_voltage and pdata->gain are always defined to non-zero values so remove the redundant checks from exynos_tmu_control(). There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz Acked-by: Kyungmin Park --- drivers/thermal/samsung/exynos_tmu.c | 12 ++++-------- drivers/thermal/samsung/exynos_tmu.h | 4 ++-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 6bc8a20..122ae66 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -274,15 +274,11 @@ static void exynos_tmu_control(struct platform_device *pdev, bool on) if (pdata->test_mux) con |= (pdata->test_mux << reg->test_mux_addr_shift); - if (pdata->reference_voltage) { - con &= ~(reg->buf_vref_sel_mask << reg->buf_vref_sel_shift); - con |= pdata->reference_voltage << reg->buf_vref_sel_shift; - } + con &= ~(reg->buf_vref_sel_mask << reg->buf_vref_sel_shift); + con |= pdata->reference_voltage << reg->buf_vref_sel_shift; - if (pdata->gain) { - con &= ~(reg->buf_slope_sel_mask << reg->buf_slope_sel_shift); - con |= (pdata->gain << reg->buf_slope_sel_shift); - } + con &= ~(reg->buf_slope_sel_mask << reg->buf_slope_sel_shift); + con |= (pdata->gain << reg->buf_slope_sel_shift); if (pdata->noise_cancel_mode) { con &= ~(reg->therm_trip_mode_mask << diff --git a/drivers/thermal/samsung/exynos_tmu.h b/drivers/thermal/samsung/exynos_tmu.h index 5514d68..327c64f 100644 --- a/drivers/thermal/samsung/exynos_tmu.h +++ b/drivers/thermal/samsung/exynos_tmu.h @@ -201,10 +201,10 @@ struct exynos_tmu_registers { * @max_trigger_level: max trigger level supported by the TMU * @non_hw_trigger_levels: number of defined non-hardware trigger levels * @gain: gain of amplifier in the positive-TC generator block - * 0 <= gain <= 15 + * 0 < gain <= 15 * @reference_voltage: reference voltage of amplifier * in the positive-TC generator block - * 0 <= reference_voltage <= 31 + * 0 < reference_voltage <= 31 * @noise_cancel_mode: noise cancellation mode * 000, 100, 101, 110 and 111 can be different modes * @type: determines the type of SOC