From patchwork Fri Mar 24 17:13:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 9643397 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 08ED4601E9 for ; Fri, 24 Mar 2017 17:14:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB08526E4D for ; Fri, 24 Mar 2017 17:14:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF50526E69; Fri, 24 Mar 2017 17:14:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E5C726E4D for ; Fri, 24 Mar 2017 17:14:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965925AbdCXROK (ORCPT ); Fri, 24 Mar 2017 13:14:10 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:55083 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966837AbdCXROB (ORCPT ); Fri, 24 Mar 2017 13:14:01 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1crSmd-0003Lc-9H; Fri, 24 Mar 2017 17:13:51 +0000 From: Colin King To: alban.auzeill@sonarsource.com, Tony Lindgren , Liam Girdwood , Mark Brown , linux-omap@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] regulator: twl6030: remove redundant range check min_uV > 1300000 && min_uV <= 1350000 Date: Fri, 24 Mar 2017 17:13:50 +0000 Message-Id: <20170324171350.9953-1-colin.king@canonical.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Colin Ian King It has been pointed out to me that the range for vsel = 58 is actually dead code as this is covered by an earlier check for (min_uV >= 700000) && (min_uV <= 1420000) so remove that check completely. Reported-by: Alban Auzeill Signed-off-by: Colin Ian King --- drivers/regulator/twl6030-regulator.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/regulator/twl6030-regulator.c b/drivers/regulator/twl6030-regulator.c index 716191046a70..56aada387887 100644 --- a/drivers/regulator/twl6030-regulator.c +++ b/drivers/regulator/twl6030-regulator.c @@ -456,8 +456,6 @@ static int twl6030smps_map_voltage(struct regulator_dev *rdev, int min_uV, vsel = 60; else if ((min_uV > 1350000) && (min_uV <= 1500000)) vsel = 59; - else if ((min_uV > 1300000) && (min_uV <= 1350000)) - vsel = 58; else return -EINVAL; break;