[coreboot-gerrit] Change in coreboot[master]: drivers/storage: Fix formatting issues detected by checkpatch

Lee Leahy (Code Review) gerrit at coreboot.org
Mon Mar 27 21:40:00 CEST 2017


Lee Leahy has uploaded a new change for review. ( https://review.coreboot.org/19009 )

Change subject: drivers/storage: Fix formatting issues detected by checkpatch
......................................................................

drivers/storage: Fix formatting issues detected by checkpatch

Fix the following errors and warnings detected by checkpatch.pl:

ERROR: switch and case should be at the same indent
ERROR: spaces prohibited around that '->' (ctx:VxW)
WARNING: line over 80 characters
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
WARNING: suspect code indent for conditional statements (24, 28)

These issues should not change the binary.

TEST=None

Change-Id: I6df6bc5f5342bbdd024a96f2396af558d8cdbc49
Signed-off-by: Lee Leahy <Leroy.P.Leahy at intel.com>
---
M src/drivers/storage/mmc.c
M src/drivers/storage/sdhci.c
M src/include/device/sdhci.h
3 files changed, 50 insertions(+), 49 deletions(-)


  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/09/19009/1

diff --git a/src/drivers/storage/mmc.c b/src/drivers/storage/mmc.c
index a5394e3..93daba0 100644
--- a/src/drivers/storage/mmc.c
+++ b/src/drivers/storage/mmc.c
@@ -472,7 +472,7 @@
 		mmc_trace("\t%p ext_csd:", ctrlr);
 		for (i = 0; i < size; i++) {
 			if (!(i % 32))
-			    printf("\n");
+				printf("\n");
 			printf(" %2.2x", ext_csd[i]);
 		}
 		printf("\n");
@@ -722,18 +722,18 @@
 	media->scr[1] = be32toh(scr[1]);
 
 	switch ((media->scr[0] >> 24) & 0xf) {
-		case 0:
-			media->version = SD_VERSION_1_0;
-			break;
-		case 1:
-			media->version = SD_VERSION_1_10;
-			break;
-		case 2:
-			media->version = SD_VERSION_2;
-			break;
-		default:
-			media->version = SD_VERSION_1_0;
-			break;
+	case 0:
+		media->version = SD_VERSION_1_0;
+		break;
+	case 1:
+		media->version = SD_VERSION_1_10;
+		break;
+	case 2:
+		media->version = SD_VERSION_2;
+		break;
+	default:
+		media->version = SD_VERSION_1_0;
+		break;
 	}
 
 	if (media->scr[0] & SD_DATA_4BIT)
@@ -873,24 +873,24 @@
 	if (media->version == MMC_VERSION_UNKNOWN) {
 		int version = extract_uint32_bits(media->csd, 2, 4);
 		switch (version) {
-			case 0:
-				media->version = MMC_VERSION_1_2;
-				break;
-			case 1:
-				media->version = MMC_VERSION_1_4;
-				break;
-			case 2:
-				media->version = MMC_VERSION_2_2;
-				break;
-			case 3:
-				media->version = MMC_VERSION_3;
-				break;
-			case 4:
-				media->version = MMC_VERSION_4;
-				break;
-			default:
-				media->version = MMC_VERSION_1_2;
-				break;
+		case 0:
+			media->version = MMC_VERSION_1_2;
+			break;
+		case 1:
+			media->version = MMC_VERSION_1_4;
+			break;
+		case 2:
+			media->version = MMC_VERSION_2_2;
+			break;
+		case 3:
+			media->version = MMC_VERSION_3;
+			break;
+		case 4:
+			media->version = MMC_VERSION_4;
+			break;
+		default:
+			media->version = MMC_VERSION_1_2;
+			break;
 		}
 	}
 	media->tran_speed = mmc_calculate_transfer_speed(media->csd[0]);
@@ -999,8 +999,8 @@
 			if (!width) {
 				mmc_set_bus_width(media->ctrlr, 1);
 				break;
-			} else
-				mmc_set_bus_width(media->ctrlr, 4 * width);
+			}
+			mmc_set_bus_width(media->ctrlr, 4 * width);
 
 			err = mmc_send_ext_csd(media->ctrlr, test_csd);
 			if (!err &&
diff --git a/src/drivers/storage/sdhci.c b/src/drivers/storage/sdhci.c
index d16b324..53de31b 100644
--- a/src/drivers/storage/sdhci.c
+++ b/src/drivers/storage/sdhci.c
@@ -189,7 +189,7 @@
 
 	/* Now set up the descriptor chain. */
 	for (i = 0; togo; i++) {
-		unsigned desc_length;
+		unsigned int desc_length;
 
 		if (togo < SDHCI_MAX_PER_DESCRIPTOR)
 			desc_length = togo;
diff --git a/src/include/device/sdhci.h b/src/include/device/sdhci.h
index 631d711..661b85d 100644
--- a/src/include/device/sdhci.h
+++ b/src/include/device/sdhci.h
@@ -152,12 +152,13 @@
 #define  SDHCI_INT_NORMAL_MASK	0x00007FFF
 #define  SDHCI_INT_ERROR_MASK	0xFFFF8000
 
-#define  SDHCI_INT_CMD_MASK	(SDHCI_INT_RESPONSE | SDHCI_INT_TIMEOUT | \
-				 SDHCI_INT_CRC | SDHCI_INT_END_BIT | SDHCI_INT_INDEX)
-#define  SDHCI_INT_DATA_MASK	(SDHCI_INT_DATA_END | SDHCI_INT_DMA_END | \
-				 SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL | \
-				 SDHCI_INT_DATA_TIMEOUT | SDHCI_INT_DATA_CRC | \
-				 SDHCI_INT_DATA_END_BIT | SDHCI_INT_ADMA_ERROR)
+#define  SDHCI_INT_CMD_MASK	(SDHCI_INT_RESPONSE | SDHCI_INT_TIMEOUT \
+				| SDHCI_INT_CRC | SDHCI_INT_END_BIT \
+				| SDHCI_INT_INDEX)
+#define  SDHCI_INT_DATA_MASK	(SDHCI_INT_DATA_END | SDHCI_INT_DMA_END \
+				| SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL \
+				| SDHCI_INT_DATA_TIMEOUT | SDHCI_INT_DATA_CRC \
+				| SDHCI_INT_DATA_END_BIT | SDHCI_INT_ADMA_ERROR)
 #define SDHCI_INT_ALL_MASK	((unsigned int)-1)
 
 #define SDHCI_ACMD12_ERR	0x3C
@@ -297,15 +298,15 @@
 	void *ioaddr;
 
 	int initialized;
-	unsigned quirks;
-	unsigned host_caps;
-	unsigned version;
-	unsigned clock; /* current, min and max interface clocks */
-	unsigned clock_f_min;
-	unsigned clock_f_max;
-	unsigned clock_base; /* controller base clock */
+	unsigned int quirks;
+	unsigned int host_caps;
+	unsigned int version;
+	unsigned int clock; /* current, min and max interface clocks */
+	unsigned int clock_f_min;
+	unsigned int clock_f_max;
+	unsigned int clock_base; /* controller base clock */
 	int removable;
-	unsigned voltages;
+	unsigned int voltages;
 
 	/*
 	 * Dynamically allocated array of ADMA descriptors to use for data
@@ -314,7 +315,7 @@
 	SdhciAdma *adma_descs;
 	SdhciAdma64 *adma64_descs;
 	/* select 32bit or 64bit ADMA operations */
-	unsigned dma64;
+	unsigned int dma64;
 
 	/* Number of ADMA descriptors currently in the array. */
 	int adma_desc_count;

-- 
To view, visit https://review.coreboot.org/19009
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6df6bc5f5342bbdd024a96f2396af558d8cdbc49
Gerrit-PatchSet: 1
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Lee Leahy <leroy.p.leahy at intel.com>



More information about the coreboot-gerrit mailing list