From patchwork Tue Oct 4 06:45:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 612470 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51AD3C4332F for ; Tue, 4 Oct 2022 06:45:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229482AbiJDGpe (ORCPT ); Tue, 4 Oct 2022 02:45:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbiJDGpe (ORCPT ); Tue, 4 Oct 2022 02:45:34 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57ADB252B9; Mon, 3 Oct 2022 23:45:31 -0700 (PDT) Received: from lenovo.Home (unknown [39.45.148.204]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madras.collabora.co.uk (Postfix) with ESMTPSA id BC0A0660225F; Tue, 4 Oct 2022 07:45:28 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1664865930; bh=22jFsalhNwXYUDUi3MSy6myd6rIR0j2CZtZOcnwFfos=; h=From:To:Cc:Subject:Date:From; b=jeQDHB4eBbeeKdzLx87y71kw8Bm35Rj69kZ7eNtMEGiZvaDRhufRyclqWgkP5tZ2Z m2ewGZ9ljOy4DQfs8Bdt8y+l9Qv/+m28HloUNVCYVPmc+M1lWK4gijtazAUsDdHq3N YgG7/ASfh5H2KfvrszV1Hu4C7sD+UTZbRUSktSGiiwRnp5eGurMid+2H58RF9obNQJ CbGaGilsfqcnWxsURpdc36EJU4E2rS9S6IMgjA+895E0bO0mCWoGrZ3jo+wc4yXGfw ehZV/BQCS807ngkwDqaiuNs6yUtlOjAsqlw3aOe1tYBgXdGaZ0Smea8wZuDixjwc/o Zyf5azNIoMMrQ== From: Muhammad Usama Anjum To: Sebastian Reichel Cc: Muhammad Usama Anjum , kernel@collabora.com, kernel-janitors@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] power: supply: remove less-than-zero comparison of unsigned variables Date: Tue, 4 Oct 2022 11:45:21 +0500 Message-Id: <20221004064521.498510-1-usama.anjum@collabora.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org max_chg_vol_reg and max_chg_cur_reg are unsigned variables. The less-than-zero comparison of an unsigned value is never true. Remove these checks. Signed-off-by: Muhammad Usama Anjum --- drivers/power/supply/rk817_charger.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/power/supply/rk817_charger.c b/drivers/power/supply/rk817_charger.c index 635f051b0821..aa4b33f1bb83 100644 --- a/drivers/power/supply/rk817_charger.c +++ b/drivers/power/supply/rk817_charger.c @@ -951,12 +951,12 @@ static int rk817_battery_init(struct rk817_charger *charger, max_chg_cur_reg = rk817_chg_cur_to_reg(max_chg_cur_ma); - if (max_chg_vol_reg < 0 || max_chg_vol_reg > 7) { + if (max_chg_vol_reg > 7) { return dev_err_probe(charger->dev, -EINVAL, "invalid max charger voltage, value %u unsupported\n", max_chg_vol_mv * 1000); } - if (max_chg_cur_reg < 0 || max_chg_cur_reg > 7) { + if (max_chg_cur_reg > 7) { return dev_err_probe(charger->dev, -EINVAL, "invalid max charger current, value %u unsupported\n", max_chg_cur_ma * 1000);