From patchwork Tue Jun 17 17:27:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 4369401 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 9ECEBBEEAA for ; Tue, 17 Jun 2014 17:31:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0F14B20109 for ; Tue, 17 Jun 2014 17:31:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B2CB1202B4 for ; Tue, 17 Jun 2014 17:31:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965034AbaFQRbN (ORCPT ); Tue, 17 Jun 2014 13:31:13 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:25874 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964772AbaFQRbJ (ORCPT ); Tue, 17 Jun 2014 13:31:09 -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 <0N7B00G2YPZW6560@mailout2.samsung.com>; Wed, 18 Jun 2014 02:31:08 +0900 (KST) X-AuditID: cbfee61a-b7fef6d00000200b-3d-53a07b5c671d Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id E5.7E.08203.C5B70A35; Wed, 18 Jun 2014 02:31:08 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N7B005Z8PTRX580@mmp2.samsung.com>; Wed, 18 Jun 2014 02:31:07 +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 v2 8/9] thermal: exynos: remove redundant pdata checks from exynos_tmu_control() Date: Tue, 17 Jun 2014 19:27:24 +0200 Message-id: <1403026045-16024-9-git-send-email-b.zolnierkie@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1403026045-16024-1-git-send-email-b.zolnierkie@samsung.com> References: <1403026045-16024-1-git-send-email-b.zolnierkie@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrMLMWRmVeSWpSXmKPExsVy+t9jQd2Y6gXBBjNmc1o0XA2x2DhjPavF mv0/mSzONr1ht7i8aw6bxefeI4wWM87vY7I4c/oSq8WTh31sFutnvGZx4PJYvOclk8eWq+0s Hn1bVjF6HL+xncnj8ya5ANYoLpuU1JzMstQifbsEroxznx+yFmwSqrg8bTljA+MZ/i5GTg4J AROJddtfMkHYYhIX7q1n62Lk4hASmM4osXbfAkYIp4tJ4t7hp6wgVWwCVhIT21cxgtgiAnoS N148YQIpYhY4ziTx8/d5NpCEsECSxNE7bWANLAKqElN+PGEBsXkFPCT2z7rGCLFOUaL72QSw ek4BT4kb91rAbCGgmvkXO5kmMPIuYGRYxSiaWpBcUJyUnmuoV5yYW1yal66XnJ+7iREcdM+k djCubLA4xCjAwajEw8uRuyBYiDWxrLgy9xCjBAezkgjvuSygEG9KYmVValF+fFFpTmrxIUZp DhYlcd4DrdaBQgLpiSWp2ampBalFMFkmDk6pBsYe1sbILX575l+o/Ra8InxWpCnzK0H3b3z5 vFOYlxTtf6p+KOBMdkbq1O1rmep7H2+rXWizx8nRZO2Uza//tyr/Kept+tSaGZ+waO+qVe6W bvqmT4x43eoYjzucWj1x16lz9d+FxGTXRwrkmvIK8v7y9PDLmbzh6e0P7YUL/JYplD6a8n/u PGklluKMREMt5qLiRACCnpBJNgIAAA== 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.9 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 9455b23..b22f358 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -229,15 +229,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 b1c9f8d..5d36708 100644 --- a/drivers/thermal/samsung/exynos_tmu.h +++ b/drivers/thermal/samsung/exynos_tmu.h @@ -188,10 +188,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