Linux Kernels

mmc: sh-mmcif: (cosmetic) simplify boolean return blocks

This change “mmc: sh-mmcif: (cosmetic) simplify boolean return blocks” (commit 3050197) in Linux kernel is authored by Guennadi Liakhovetski <g.liakhovetski [at] gmx.de> on Wed Dec 12 15:38:13 2012 +0100.

Description of "mmc: sh-mmcif: (cosmetic) simplify boolean return blocks"

The change “mmc: sh-mmcif: (cosmetic) simplify boolean return blocks” introduces changes as follows.

mmc: sh-mmcif: (cosmetic) simplify boolean return blocks

Use "return condition" instead of "if (condition) return true; return false"
in functions, returning bool.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Chris Ball <cjb@laptop.org>

Linux kernel releases containing commit 3050197

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "mmc: sh-mmcif: (cosmetic) simplify boolean return blocks"

There are 9 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/mmc/host/sh_mmcif.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
 
diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index 8aa7b0e6dec2..de4b6d073599 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -542,10 +542,7 @@ static bool sh_mmcif_next_block(struct sh_mmcif_host *host, u32 *p)
 		host->pio_ptr = p;
 	}
 
-	if (host->sg_idx == data->sg_len)
-		return false;
-
-	return true;
+	return host->sg_idx != data->sg_len;
 }
 
 static void sh_mmcif_single_read(struct sh_mmcif_host *host,
@@ -1071,9 +1068,7 @@ static bool sh_mmcif_end_cmd(struct sh_mmcif_host *host)
 
 	if (!host->dma_active) {
 		data->error = sh_mmcif_data_trans(host, host->mrq, cmd->opcode);
-		if (!data->error)
-			return true;
-		return false;
+		return !data->error;
 	}
 
 	/* Running in the IRQ thread, can sleep */

The commit for this change in Linux stable tree is 3050197 (patch).

Last modified: 2020/01/11 09:38