Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: omap_hsmmc: Simplify bool comparison and conversion

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

According to the context, vqmmc_enabled is more suitable for bool type.

Reported-by: Abaci Robot<abaci@linux.alibaba.com>
Signed-off-by: Yang Li <abaci-bugfix@linux.alibaba.com>
Link: https://lore.kernel.org/r/1610704281-11036-1-git-send-email-abaci-bugfix@linux.alibaba.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Yang Li and committed by
Ulf Hansson
eab234fc 6b1dc622

+9 -9
+9 -9
drivers/mmc/host/omap_hsmmc.c
··· 177 177 struct regulator *pbias; 178 178 bool pbias_enabled; 179 179 void __iomem *base; 180 - int vqmmc_enabled; 180 + bool vqmmc_enabled; 181 181 resource_size_t mapbase; 182 182 spinlock_t irq_lock; /* Prevent races with irq handler */ 183 183 unsigned int dma_len; ··· 232 232 dev_err(mmc_dev(mmc), "vmmc_aux reg enable failed\n"); 233 233 goto err_vqmmc; 234 234 } 235 - host->vqmmc_enabled = 1; 235 + host->vqmmc_enabled = true; 236 236 } 237 237 238 238 return 0; ··· 256 256 dev_err(mmc_dev(mmc), "vmmc_aux reg disable failed\n"); 257 257 return ret; 258 258 } 259 - host->vqmmc_enabled = 0; 259 + host->vqmmc_enabled = false; 260 260 } 261 261 262 262 if (!IS_ERR(mmc->supply.vmmc)) { ··· 285 285 return 0; 286 286 287 287 if (power_on) { 288 - if (host->pbias_enabled == 0) { 288 + if (!host->pbias_enabled) { 289 289 ret = regulator_enable(host->pbias); 290 290 if (ret) { 291 291 dev_err(host->dev, "pbias reg enable fail\n"); 292 292 return ret; 293 293 } 294 - host->pbias_enabled = 1; 294 + host->pbias_enabled = true; 295 295 } 296 296 } else { 297 - if (host->pbias_enabled == 1) { 297 + if (host->pbias_enabled) { 298 298 ret = regulator_disable(host->pbias); 299 299 if (ret) { 300 300 dev_err(host->dev, "pbias reg disable fail\n"); 301 301 return ret; 302 302 } 303 - host->pbias_enabled = 0; 303 + host->pbias_enabled = false; 304 304 } 305 305 } 306 306 ··· 1861 1861 host->base = base + pdata->reg_offset; 1862 1862 host->power_mode = MMC_POWER_OFF; 1863 1863 host->next_data.cookie = 1; 1864 - host->pbias_enabled = 0; 1865 - host->vqmmc_enabled = 0; 1864 + host->pbias_enabled = false; 1865 + host->vqmmc_enabled = false; 1866 1866 1867 1867 platform_set_drvdata(pdev, host); 1868 1868