[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221004073652.568681-1-usama.anjum@collabora.com>
Date: Tue, 4 Oct 2022 12:36:51 +0500
From: Muhammad Usama Anjum <usama.anjum@...labora.com>
To: Sebastian Reichel <sre@...nel.org>
Cc: Muhammad Usama Anjum <usama.anjum@...labora.com>,
kernel@...labora.com, kernel-janitors@...r.kernel.org,
linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] power: supply: remove dead code
tmp is an unsigned variable. It can never be less than zero. Remove the
dead code.
Signed-off-by: Muhammad Usama Anjum <usama.anjum@...labora.com>
---
drivers/power/supply/rk817_charger.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/power/supply/rk817_charger.c b/drivers/power/supply/rk817_charger.c
index aa4b33f1bb83..ba3f5ccaeacd 100644
--- a/drivers/power/supply/rk817_charger.c
+++ b/drivers/power/supply/rk817_charger.c
@@ -785,8 +785,6 @@ rk817_read_or_set_full_charge_on_boot(struct rk817_charger *charger,
regmap_bulk_read(rk808->regmap, RK817_GAS_GAUGE_Q_PRES_H3,
bulk_reg, 4);
tmp = get_unaligned_be32(bulk_reg);
- if (tmp < 0)
- tmp = 0;
boot_charge_mah = ADC_TO_CHARGE_UAH(tmp,
charger->res_div) / 1000;
/*
@@ -825,8 +823,6 @@ rk817_read_or_set_full_charge_on_boot(struct rk817_charger *charger,
regmap_bulk_read(rk808->regmap, RK817_GAS_GAUGE_Q_PRES_H3,
bulk_reg, 4);
tmp = get_unaligned_be32(bulk_reg);
- if (tmp < 0)
- tmp = 0;
boot_charge_mah = ADC_TO_CHARGE_UAH(tmp, charger->res_div) / 1000;
regmap_bulk_read(rk808->regmap, RK817_GAS_GAUGE_OCV_VOL_H,
bulk_reg, 2);
--
2.30.2
Powered by blists - more mailing lists