From patchwork Fri Jun 26 06:57:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 191809 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp214554ilg; Thu, 25 Jun 2020 23:58:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9NDJg97Y8Y13I0L7wbPdqHLFnf0VO7BjXbI7TSaLGVxBf4CQRSH/G1VyOmMGEdAcHsAb8 X-Received: by 2002:a17:906:c047:: with SMTP id bm7mr1202436ejb.499.1593154696309; Thu, 25 Jun 2020 23:58:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593154696; cv=none; d=google.com; s=arc-20160816; b=UMbWUZDwjVCRU+Cl4ohaDQ69lXbGHjOugCG2OLhFhzjud0IgoEtvAPsn+SYYoYEDvu GyVte5ZTsHmcqJvRxg/jPWvImWFJ1b7WgPSY9lYZVg+v2okajdKHoTjbsDiGpWkQfPgP gp8Wz+tX0eco5xKRWOR4j/7kfYrp1LKtFa2v6/Ev/MgEkNJ/fyDZwYn5SSGgxUeCmUtz 932y6zlGG9tZDIRdfGq6Pz68o97TK3jd95c/WGThrUOerGyUjOEP6LwQD/FDREfGVVyz RlPuVeVDZLXw0t0aB2zytY0WSJ7P7/HDcQhV4YXOXBmCx593hkaUlV/J7OyGZZaFD6bH vetQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LxP+pj5dAfq9jSQlmqxGkL2BQjDUMxM20D8uW61hd/0=; b=Pse346k2BFQtRmZfgPJ4s28mo9My3ogLrTDvlcUUi58shnbOk6YpGN8hrfA/KM6+zQ AEe48NTlLSfv4IdInDt3oP8MpXVB7VrijSbt8SAJ3Wqnoy0zNMNEoQMx+HzarjipJfoK epvgNtqibvEOTk+q3olasg7jRawr1wItRIHLjzOcWIaajc3Acm77P4GJb9CoD5CHpIiF nEEcn9it8wi83meDvFx85gXnTfUysQH0LBzk6HFcyPKnTH5c1McZNgBYOIw84zt84VPP JzhuQfXQ9vmOWPlvRh1JQyA3NGaMKUvNXiNYt9dU6sTCZLunU5X0gvfnZJjV1MR/Plro Mz8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Vfi1pBqW; spf=pass (google.com: domain of linux-omap-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d6si1541172eds.492.2020.06.25.23.58.16; Thu, 25 Jun 2020 23:58:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-omap-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Vfi1pBqW; spf=pass (google.com: domain of linux-omap-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728622AbgFZG6K (ORCPT + 4 others); Fri, 26 Jun 2020 02:58:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728585AbgFZG5v (ORCPT ); Fri, 26 Jun 2020 02:57:51 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09412C08C5DB for ; Thu, 25 Jun 2020 23:57:51 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id f139so8292693wmf.5 for ; Thu, 25 Jun 2020 23:57:50 -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=LxP+pj5dAfq9jSQlmqxGkL2BQjDUMxM20D8uW61hd/0=; b=Vfi1pBqWKvy+Zc8b6ok7wbVccd/dzbvbdRZeJ5pR8nYf1oFkBEn+32PfanZ68mKmr4 X7Tz4VRmpdTJNEbXUjgt/SMOKgRA7SoYdp1+rdmzItdFaoND9odQiqI4x7PWlymMow7j 47xl3ZNui7jVUD3/NPVzpvi3EVWYilYP2Jzrcr63XY4eDP1liqeFJQyXGPgziN12Wj82 b/Wl7AaVTxk1N7JZssKKbllkIfoVOUuPtnnjpdNEOVIDFnW/8NycoeMynve7OiuLkyFm MSiuq21fBdUJwWGnr52ypxku7WTHmFnVpZf+bceWW8T7hjkb7IxLrE+km3hzsv6Wnq9y QqIg== 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=LxP+pj5dAfq9jSQlmqxGkL2BQjDUMxM20D8uW61hd/0=; b=GrLMRT3iq+Ms1GAIsvDWF3Tu95spyRmPGH/jooLHBB1bEn1qiN6+9X3bzzeOsfsEpH 1BFegyMaYKd+43Df22qFv5UYKqHo4G1CxWCMF6l0Im2gIdvFIHCCs5bHyor7a0WlZDja OWrUlUkZJzOCkdOSBFrE0QlFbTkU+HyBFu4KYdQni4yijJtcYmkewurJw31vEhXi4/iq E6ntVO2CR0CUHd1T2bcYXP3ICIKt7EWxQRMfDqfSuWN8i7HO8UywmpyvGaO3g/O47XD5 LRbjDNRvBvl+TnXgsY7VJC0aRhiPMVUmhg/maqUVFwyRiqWtXg+kz8mh2PDn0cq9+ZHu P7Pg== X-Gm-Message-State: AOAM533sj5NtfLuyoInqooAwuAtEhtJB0mOd0aefbNaL5fBHAfqnIkwB JMEM3BRv+p1xkk5MlNNyAVNRfw== X-Received: by 2002:a1c:4185:: with SMTP id o127mr1808366wma.8.1593154669736; Thu, 25 Jun 2020 23:57:49 -0700 (PDT) Received: from localhost.localdomain ([2.27.35.144]) by smtp.gmail.com with ESMTPSA id x18sm15355269wmi.35.2020.06.25.23.57.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jun 2020 23:57:49 -0700 (PDT) From: Lee Jones To: broonie@kernel.org, lgirdwood@gmail.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Lee Jones , Keerthy , Tero Kristo , Dave Gerlach , linux-omap@vger.kernel.org Subject: [PATCH 7/9] regulator: tps65218-regulator: Remove pointless 'is unsigned int <0' check Date: Fri, 26 Jun 2020 07:57:36 +0100 Message-Id: <20200626065738.93412-8-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 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.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/tps65218-regulator.c: In function ‘tps65218_pmic_set_suspend_enable’: drivers/regulator/tps65218-regulator.c:131:10: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] 131 | if (rid < TPS65218_DCDC_1 || rid > TPS65218_LDO_1) | ^ drivers/regulator/tps65218-regulator.c: In function ‘tps65218_pmic_set_suspend_disable’: drivers/regulator/tps65218-regulator.c:144:10: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] 144 | if (rid < TPS65218_DCDC_1 || rid > TPS65218_LDO_1) | ^ Cc: Keerthy Cc: Tero Kristo Cc: Dave Gerlach Cc: linux-omap@vger.kernel.org Signed-off-by: Lee Jones --- drivers/regulator/tps65218-regulator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/drivers/regulator/tps65218-regulator.c b/drivers/regulator/tps65218-regulator.c index 05d13f8079182..9133d0af793a7 100644 --- a/drivers/regulator/tps65218-regulator.c +++ b/drivers/regulator/tps65218-regulator.c @@ -128,7 +128,7 @@ static int tps65218_pmic_set_suspend_enable(struct regulator_dev *dev) struct tps65218 *tps = rdev_get_drvdata(dev); unsigned int rid = rdev_get_id(dev); - if (rid < TPS65218_DCDC_1 || rid > TPS65218_LDO_1) + if (rid > TPS65218_LDO_1) return -EINVAL; return tps65218_clear_bits(tps, dev->desc->bypass_reg, @@ -141,7 +141,7 @@ static int tps65218_pmic_set_suspend_disable(struct regulator_dev *dev) struct tps65218 *tps = rdev_get_drvdata(dev); unsigned int rid = rdev_get_id(dev); - if (rid < TPS65218_DCDC_1 || rid > TPS65218_LDO_1) + if (rid > TPS65218_LDO_1) return -EINVAL; /*