From patchwork Fri Jun 26 06:57:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 11627187 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 506CB6C1 for ; Fri, 26 Jun 2020 11:11:50 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2085620724 for ; Fri, 26 Jun 2020 11:11:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="xGl3zbJA"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="V+f/N1sh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2085620724 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=KNM45Tu1NxsJBFhiTydOY7fBUY9faMzIa+3v5HdbAOc=; b=xGl3zbJAG4nPjGYKHAuvMjf13 PRiLxqQGeC6CtL7Aa8GwySGO/eFxvloG/M9cJqPlYZbHVkT4NkxNi/JUKFr+TfuZZF9hfIo97qK7f +C+9RQslonl8is6XnG9FboiX205BQYETC8TtNmX3ddpJHlLuwdubB3s0iJp+NGPnHoW0quzKWn4N2 xBXDR3nRrhg2pLpjVz5NADZFsXv9hWzNG9kITuLCBFayFAHYu0apDMjflW4fRL1kOYLsx+fNfCRf3 ibP78qCwO1S4ejNAZiVCayI8Edp4FupaU1waPK237DRVdTjbyENX74GAErjzuDB8seNHwZKvPckIJ G/LOujToQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jomDo-0003c1-9o; Fri, 26 Jun 2020 11:08:40 +0000 Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jol6s-0006DM-BC for linux-arm-kernel@lists.infradead.org; Fri, 26 Jun 2020 09:57:37 +0000 Received: by mail-lj1-x241.google.com with SMTP id s9so9642432ljm.11 for ; Fri, 26 Jun 2020 02:57:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7sD07a6En2jWPWH2kq8TUsn+RVkOBsvIFsWTqmBLW7Y=; b=V+f/N1sh9o182ePat9lbQamPC/xUQtqafZxm5ypirNrQKbDKBqQ4bjIcONYNaxl3bT SOVYt7m9hF2UYTxbT6EE1TVluOIxfDnbWgmea430ebNS8wCS8vBhHomJYiPwr3dEw7nC BEfJ83GZIJxiNxsokwodTwezX9wpLi5ZXnRjQ9jRvzdWxNoh+R56OGC3sRqBw2Mznu3Y HRU8Tb95/BKVOjFpbvDZbTd2016NZeX+SU7QjLc8cZed6J4jfxNf8yNYRNAiphrQYfo+ +5Vhrl7fj0n00G1l4XVsH0+wvvgUzFYgutMbkcK/ayG549z0zXCUKOd4GUhIXV2+r/vu vlyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7sD07a6En2jWPWH2kq8TUsn+RVkOBsvIFsWTqmBLW7Y=; b=ClqbI/Z3paNa2eC6mt8usxOXL8jIXAylrjDdvCn3m24Zac9S0H+l3/v9C1rgv4GgyJ cKCilh1sa73ioLMSRrdU6ciHcxkht6xwoIeaYgfj7JU4SxK+3An6p+tP2QyCj2rkBe7S OHGRrQwur9FtxcKo4FGPUEEqj6nirlTcOILc/3IWZWj3xcbGoTOMZ0Yu4zZwzrM0dLTr PtL69+dqoDplQeMQFVCpV2rxg79a4NowGwVhGRjotA0JUhy9l55em4PxGSdOBQakjQkU CjfdHGp/wKqWEEKHmgI7KocKCrpGUxsiQv7DAJZsiCSbEGVjhnfPoYTL1JiSWaL2csYw JxzA== X-Gm-Message-State: AOAM531j41xCMTfbPyCBL7KJTBMDtpzs3DQUM5H0f6yrPz5dJElI/9Em Y2T2qvSyhxDxTXGs3EZDkusvj9Roi50= X-Google-Smtp-Source: ABdhPJxS9JeaA9nugKhk00ilscAGO+mjKuClzKn+M1SFU8Zww2GY/t5YayskghAfrWlTh0txvkRTVw== X-Received: by 2002:adf:f546:: with SMTP id j6mr2063748wrp.167.1593154667581; Thu, 25 Jun 2020 23:57:47 -0700 (PDT) Received: from localhost.localdomain ([2.27.35.144]) by smtp.gmail.com with ESMTPSA id x18sm15355269wmi.35.2020.06.25.23.57.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jun 2020 23:57:47 -0700 (PDT) From: Lee Jones To: broonie@kernel.org, lgirdwood@gmail.com Subject: [PATCH 5/9] regulator: tps65217-regulator: Remove pointless 'is unsigned int <0' check Date: Fri, 26 Jun 2020 07:57:34 +0100 Message-Id: <20200626065738.93412-6-lee.jones@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200626065738.93412-1-lee.jones@linaro.org> References: <20200626065738.93412-1-lee.jones@linaro.org> MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:241 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Keerthy , linux-kernel@vger.kernel.org, Russ Dill , AnilKumar Ch , linux-omap@vger.kernel.org, Lee Jones , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 'rid' is declared as unsigned int, so there is little point checking for <0. Removing these checks fixes the following W=1 warnings: drivers/regulator/tps65217-regulator.c: In function ‘tps65217_pmic_set_suspend_enable’: drivers/regulator/tps65217-regulator.c:127:10: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] 127 | if (rid < TPS65217_DCDC_1 || rid > TPS65217_LDO_4) | ^ drivers/regulator/tps65217-regulator.c: In function ‘tps65217_pmic_set_suspend_disable’: drivers/regulator/tps65217-regulator.c:140:10: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] 140 | if (rid < TPS65217_DCDC_1 || rid > TPS65217_LDO_4) | ^ Cc: Russ Dill Cc: Keerthy Cc: AnilKumar Ch Cc: linux-omap@vger.kernel.org Signed-off-by: Lee Jones --- drivers/regulator/tps65217-regulator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/tps65217-regulator.c b/drivers/regulator/tps65217-regulator.c index d27dbbafcf721..f2d3a4a9f3e77 100644 --- a/drivers/regulator/tps65217-regulator.c +++ b/drivers/regulator/tps65217-regulator.c @@ -124,7 +124,7 @@ static int tps65217_pmic_set_suspend_enable(struct regulator_dev *dev) struct tps65217 *tps = rdev_get_drvdata(dev); unsigned int rid = rdev_get_id(dev); - if (rid < TPS65217_DCDC_1 || rid > TPS65217_LDO_4) + if (rid > TPS65217_LDO_4) return -EINVAL; return tps65217_clear_bits(tps, dev->desc->bypass_reg, @@ -137,7 +137,7 @@ static int tps65217_pmic_set_suspend_disable(struct regulator_dev *dev) struct tps65217 *tps = rdev_get_drvdata(dev); unsigned int rid = rdev_get_id(dev); - if (rid < TPS65217_DCDC_1 || rid > TPS65217_LDO_4) + if (rid > TPS65217_LDO_4) return -EINVAL; if (!tps->strobes[rid])