mmc: host: sdhci: Use BUG_ON()
authorFabio Estevam <fabio.estevam@freescale.com>
Sat, 9 May 2015 21:44:51 +0000 (18:44 -0300)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 1 Jun 2015 07:07:02 +0000 (09:07 +0200)
Use BUG_ON() instead of an 'if' condition followed by BUG().

The semantic patch that makes this change is available
in scripts/coccinelle/misc/bugon.cocci.

More information about semantic patching is available at
http://coccinelle.lip6.fr/

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci.c

index b34584420a8f64bd1ec3b79189f554bf6ad1683b..58c1770e879d6b73bc9edafa634e0af849f818a8 100644 (file)
@@ -316,8 +316,7 @@ static void sdhci_read_block_pio(struct sdhci_host *host)
        local_irq_save(flags);
 
        while (blksize) {
-               if (!sg_miter_next(&host->sg_miter))
-                       BUG();
+               BUG_ON(!sg_miter_next(&host->sg_miter));
 
                len = min(host->sg_miter.length, blksize);
 
@@ -362,8 +361,7 @@ static void sdhci_write_block_pio(struct sdhci_host *host)
        local_irq_save(flags);
 
        while (blksize) {
-               if (!sg_miter_next(&host->sg_miter))
-                       BUG();
+               BUG_ON(!sg_miter_next(&host->sg_miter));
 
                len = min(host->sg_miter.length, blksize);