Skip to contentSkip to conversation

host: omap_hsmmc: style: Simplify bool comparison

PATCH Superseded YANG LI 2 participants 2 messages Jan 11, 2021 – Jan 13, 2021

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

YANG LI

author
#0 lore raw

PATCH 1/1 host: omap_hsmmc: style: Simplify bool comparison

Fix the following coccicheck warning:
./drivers/mmc/host/omap_hsmmc.c:297:6-25: WARNING: Comparison of 0/1 to bool variable

---
 drivers/mmc/host/omap_hsmmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/omap_hsmmc.c +1 -1
index aa9cc49..91a0760 100644
@@ -294,7 +294,7 @@ static int omap_hsmmc_set_pbias(struct omap_hsmmc_host *host, bool power_on)
 			host->pbias_enabled = 1;
 		}
 	} else {
-		if (host->pbias_enabled == 1) {
+		if (host->pbias_enabled) {
 			ret = regulator_disable(host->pbias);
 			if (ret) {
 				dev_err(host->dev, "pbias reg disable fail\n");
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 4 lines · YANG LI

Fix the following coccicheck warning:
./drivers/mmc/host/omap_hsmmc.c:297:6-25: WARNING: Comparison of 0/1 to bool variable

If you really want this change, I prefer if you can clean up all use of "pbias_enabled" - and at the same time, do the same clean up for "vqmmc_enabled".

Kind regards
Uffe

Quoted 23 lines
---
 drivers/mmc/host/omap_hsmmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/omap_hsmmc.c +1 -2
index aa9cc49..91a0760 100644
@@ -294,7 +294,7 @@ static int omap_hsmmc_set_pbias(struct omap_hsmmc_host *host, bool power_on)
                        host->pbias_enabled = 1;
                }
        } else {
-               if (host->pbias_enabled == 1) {
+               if (host->pbias_enabled) {
                        ret = regulator_disable(host->pbias);
                        if (ret) {
                                dev_err(host->dev, "pbias reg disable fail\n");
--

1.8.3.1