All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mario Six <mario.six@gdsys.cc>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 05/26] cfi_flash: Fix indent of case statements
Date: Fri, 26 Jan 2018 14:43:35 +0100	[thread overview]
Message-ID: <20180126134356.9393-5-mario.six@gdsys.cc> (raw)
In-Reply-To: <20180126134356.9393-1-mario.six@gdsys.cc>

case statements should be at the same level of indent as the switch
keyword. Fix all instances where this occurs.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
---

v2 -> v3:
* Added proper commit message

v1 -> v2:
None

---
 drivers/mtd/cfi_flash.c | 200 ++++++++++++++++++++++++------------------------
 1 file changed, 100 insertions(+), 100 deletions(-)

diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 2dc6b09cd9..b77fd3c0a2 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -1220,29 +1220,29 @@ void flash_print_info(flash_info_t *info)
 			info->size >> 20, info->sector_count);
 	printf("  ");
 	switch (info->vendor) {
-		case CFI_CMDSET_INTEL_PROG_REGIONS:
-			printf("Intel Prog Regions");
-			break;
-		case CFI_CMDSET_INTEL_STANDARD:
-			printf("Intel Standard");
-			break;
-		case CFI_CMDSET_INTEL_EXTENDED:
-			printf("Intel Extended");
-			break;
-		case CFI_CMDSET_AMD_STANDARD:
-			printf("AMD Standard");
-			break;
-		case CFI_CMDSET_AMD_EXTENDED:
-			printf("AMD Extended");
-			break;
+	case CFI_CMDSET_INTEL_PROG_REGIONS:
+		printf("Intel Prog Regions");
+		break;
+	case CFI_CMDSET_INTEL_STANDARD:
+		printf("Intel Standard");
+		break;
+	case CFI_CMDSET_INTEL_EXTENDED:
+		printf("Intel Extended");
+		break;
+	case CFI_CMDSET_AMD_STANDARD:
+		printf("AMD Standard");
+		break;
+	case CFI_CMDSET_AMD_EXTENDED:
+		printf("AMD Extended");
+		break;
 #ifdef CONFIG_FLASH_CFI_LEGACY
-		case CFI_CMDSET_AMD_LEGACY:
-			printf("AMD Legacy");
-			break;
+	case CFI_CMDSET_AMD_LEGACY:
+		printf("AMD Legacy");
+		break;
 #endif
-		default:
-			printf("Unknown (%d)", info->vendor);
-			break;
+	default:
+		printf("Unknown (%d)", info->vendor);
+		break;
 	}
 	printf(" command set, Manufacturer ID: 0x%02X, Device ID: 0x",
 		info->manufacturer_id);
@@ -1480,94 +1480,94 @@ int flash_real_protect(flash_info_t *info, long sector, int prot)
 	int retcode = 0;

 	switch (info->vendor) {
-		case CFI_CMDSET_INTEL_PROG_REGIONS:
-		case CFI_CMDSET_INTEL_STANDARD:
-		case CFI_CMDSET_INTEL_EXTENDED:
-			if (!cfi_protect_bugfix(info, sector, prot)) {
+	case CFI_CMDSET_INTEL_PROG_REGIONS:
+	case CFI_CMDSET_INTEL_STANDARD:
+	case CFI_CMDSET_INTEL_EXTENDED:
+		if (!cfi_protect_bugfix(info, sector, prot)) {
+			flash_write_cmd(info, sector, 0,
+				 FLASH_CMD_CLEAR_STATUS);
+			flash_write_cmd(info, sector, 0,
+				FLASH_CMD_PROTECT);
+			if (prot)
 				flash_write_cmd(info, sector, 0,
-					 FLASH_CMD_CLEAR_STATUS);
+					FLASH_CMD_PROTECT_SET);
+			else
 				flash_write_cmd(info, sector, 0,
-					FLASH_CMD_PROTECT);
-				if (prot)
-					flash_write_cmd(info, sector, 0,
-						FLASH_CMD_PROTECT_SET);
-				else
-					flash_write_cmd(info, sector, 0,
-						FLASH_CMD_PROTECT_CLEAR);
+					FLASH_CMD_PROTECT_CLEAR);

+		}
+		break;
+	case CFI_CMDSET_AMD_EXTENDED:
+	case CFI_CMDSET_AMD_STANDARD:
+		/* U-Boot only checks the first byte */
+		if (manufact_match(info, ATM_MANUFACT)) {
+			if (prot) {
+				flash_unlock_seq(info, 0);
+				flash_write_cmd(info, 0,
+						info->addr_unlock1,
+						ATM_CMD_SOFTLOCK_START);
+				flash_unlock_seq(info, 0);
+				flash_write_cmd(info, sector, 0,
+						ATM_CMD_LOCK_SECT);
+			} else {
+				flash_write_cmd(info, 0,
+						info->addr_unlock1,
+						AMD_CMD_UNLOCK_START);
+				if (info->device_id == ATM_ID_BV6416)
+					flash_write_cmd(info, sector,
+						0, ATM_CMD_UNLOCK_SECT);
 			}
-			break;
-		case CFI_CMDSET_AMD_EXTENDED:
-		case CFI_CMDSET_AMD_STANDARD:
-			/* U-Boot only checks the first byte */
-			if (manufact_match(info, ATM_MANUFACT)) {
-				if (prot) {
-					flash_unlock_seq(info, 0);
-					flash_write_cmd(info, 0,
-							info->addr_unlock1,
-							ATM_CMD_SOFTLOCK_START);
-					flash_unlock_seq(info, 0);
+		}
+		if (info->legacy_unlock) {
+			int flag = disable_interrupts();
+			int lock_flag;
+
+			flash_unlock_seq(info, 0);
+			flash_write_cmd(info, 0, info->addr_unlock1,
+					AMD_CMD_SET_PPB_ENTRY);
+			lock_flag = flash_isset(info, sector, 0, 0x01);
+			if (prot) {
+				if (lock_flag) {
 					flash_write_cmd(info, sector, 0,
-							ATM_CMD_LOCK_SECT);
-				} else {
-					flash_write_cmd(info, 0,
-							info->addr_unlock1,
-							AMD_CMD_UNLOCK_START);
-					if (info->device_id == ATM_ID_BV6416)
-						flash_write_cmd(info, sector,
-							0, ATM_CMD_UNLOCK_SECT);
+						AMD_CMD_PPB_LOCK_BC1);
+					flash_write_cmd(info, sector, 0,
+						AMD_CMD_PPB_LOCK_BC2);
 				}
-			}
-			if (info->legacy_unlock) {
-				int flag = disable_interrupts();
-				int lock_flag;
-
-				flash_unlock_seq(info, 0);
-				flash_write_cmd(info, 0, info->addr_unlock1,
-						AMD_CMD_SET_PPB_ENTRY);
-				lock_flag = flash_isset(info, sector, 0, 0x01);
-				if (prot) {
-					if (lock_flag) {
-						flash_write_cmd(info, sector, 0,
-							AMD_CMD_PPB_LOCK_BC1);
-						flash_write_cmd(info, sector, 0,
-							AMD_CMD_PPB_LOCK_BC2);
-					}
-					debug("sector %ld %slocked\n", sector,
-						lock_flag ? "" : "already ");
-				} else {
-					if (!lock_flag) {
-						debug("unlock %ld\n", sector);
-						flash_write_cmd(info, 0, 0,
-							AMD_CMD_PPB_UNLOCK_BC1);
-						flash_write_cmd(info, 0, 0,
-							AMD_CMD_PPB_UNLOCK_BC2);
-					}
-					debug("sector %ld %sunlocked\n", sector,
-						!lock_flag ? "" : "already ");
+				debug("sector %ld %slocked\n", sector,
+					lock_flag ? "" : "already ");
+			} else {
+				if (!lock_flag) {
+					debug("unlock %ld\n", sector);
+					flash_write_cmd(info, 0, 0,
+						AMD_CMD_PPB_UNLOCK_BC1);
+					flash_write_cmd(info, 0, 0,
+						AMD_CMD_PPB_UNLOCK_BC2);
 				}
-				if (flag)
-					enable_interrupts();
-
-				if (flash_status_check(info, sector,
-						info->erase_blk_tout,
-						prot ? "protect" : "unprotect"))
-					printf("status check error\n");
-
-				flash_write_cmd(info, 0, 0,
-						AMD_CMD_SET_PPB_EXIT_BC1);
-				flash_write_cmd(info, 0, 0,
-						AMD_CMD_SET_PPB_EXIT_BC2);
+				debug("sector %ld %sunlocked\n", sector,
+					!lock_flag ? "" : "already ");
 			}
-			break;
+			if (flag)
+				enable_interrupts();
+
+			if (flash_status_check(info, sector,
+					info->erase_blk_tout,
+					prot ? "protect" : "unprotect"))
+				printf("status check error\n");
+
+			flash_write_cmd(info, 0, 0,
+					AMD_CMD_SET_PPB_EXIT_BC1);
+			flash_write_cmd(info, 0, 0,
+					AMD_CMD_SET_PPB_EXIT_BC2);
+		}
+		break;
 #ifdef CONFIG_FLASH_CFI_LEGACY
-		case CFI_CMDSET_AMD_LEGACY:
-			flash_write_cmd(info, sector, 0, FLASH_CMD_CLEAR_STATUS);
-			flash_write_cmd(info, sector, 0, FLASH_CMD_PROTECT);
-			if (prot)
-				flash_write_cmd(info, sector, 0, FLASH_CMD_PROTECT_SET);
-			else
-				flash_write_cmd(info, sector, 0, FLASH_CMD_PROTECT_CLEAR);
+	case CFI_CMDSET_AMD_LEGACY:
+		flash_write_cmd(info, sector, 0, FLASH_CMD_CLEAR_STATUS);
+		flash_write_cmd(info, sector, 0, FLASH_CMD_PROTECT);
+		if (prot)
+			flash_write_cmd(info, sector, 0, FLASH_CMD_PROTECT_SET);
+		else
+			flash_write_cmd(info, sector, 0, FLASH_CMD_PROTECT_CLEAR);
 #endif
 	};

--
2.11.0

  parent reply	other threads:[~2018-01-26 13:43 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-26 13:43 [U-Boot] [PATCH v3 01/26] cfi_flash: Fix space between function name and parenthesis Mario Six
2018-01-26 13:43 ` [U-Boot] [PATCH v3 02/26] cfi_flash: Fix style of pointer declarations Mario Six
2018-01-26 13:43 ` [U-Boot] [PATCH v3 03/26] cfi_flash: Fix Parenthesis spacing Mario Six
2018-01-26 13:43 ` [U-Boot] [PATCH v3 04/26] cfi_flash: Fix whitespace with casting Mario Six
2018-01-26 13:43 ` Mario Six [this message]
2018-01-26 13:43 ` [U-Boot] [PATCH v3 06/26] cfi_flash: Fix spacing around casts/operators Mario Six
2018-01-26 13:43 ` [U-Boot] [PATCH v3 07/26] cfi_flash: Fix missing/superfluous lines Mario Six
2018-01-26 13:43 ` [U-Boot] [PATCH v3 08/26] cfi_flash: Remove braces for single-statement blocks Mario Six
2018-01-26 13:43 ` [U-Boot] [PATCH v3 09/26] cfi_flash: Fix logical continuations Mario Six
2018-01-26 13:43 ` [U-Boot] [PATCH v3 10/26] cfi_flash: Use __func__ macro instead of function name Mario Six
2018-01-26 13:43 ` [U-Boot] [PATCH v3 11/26] cfi_flash: Fix comment style Mario Six
2018-01-26 13:43 ` [U-Boot] [PATCH v3 12/26] cfi_flash: Remove unnecessary braces Mario Six
2018-01-26 13:43 ` [U-Boot] [PATCH v3 13/26] cfi_flash: Add missing braces in blocks Mario Six
2018-01-26 13:43 ` [U-Boot] [PATCH v3 14/26] cfi_flash: Fix spelling of "Unknown" Mario Six
2018-01-26 13:43 ` [U-Boot] [PATCH v3 15/26] cfi_flash: Fix else after break Mario Six
2018-01-26 13:43 ` [U-Boot] [PATCH v3 16/26] cfi_flash: Fix placement of brace Mario Six
2018-01-26 13:43 ` [U-Boot] [PATCH v3 17/26] cfi_flash: Remove return from void function Mario Six
2018-01-26 13:43 ` [U-Boot] [PATCH v3 18/26] cfi_flash: Remove assignments from if conditions Mario Six
2018-01-26 13:43 ` [U-Boot] [PATCH v3 19/26] cfi_flash: Use u8 pointers instead of void pointers Mario Six
2018-01-26 13:43 ` [U-Boot] [PATCH v3 20/26] cfi_flash: Fix strings split across lines Mario Six
2018-01-26 13:43 ` [U-Boot] [PATCH v3 21/26] cfi_flash: Rename camel-case variables Mario Six
2018-01-26 13:43 ` [U-Boot] [PATCH v3 22/26] flash: Fix spelling of "ERR_TIMOUT" Mario Six
2018-01-26 13:43 ` [U-Boot] [PATCH v3 23/26] cfi_flash: Bound-check index before array access Mario Six
2018-01-26 13:43 ` [U-Boot] [PATCH v3 24/26] cfi_flash: Fix long lines Mario Six
2018-01-26 13:43 ` [U-Boot] [PATCH v3 25/26] cfi_flash: Fix indention Mario Six
2018-01-26 13:43 ` [U-Boot] [PATCH v3 26/26] cfi_flash: Always define cfi_flash_num_flash_banks Mario Six
2018-01-29 12:30 ` [U-Boot] [PATCH v3 01/26] cfi_flash: Fix space between function name and parenthesis Stefan Roese

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180126134356.9393-5-mario.six@gdsys.cc \
    --to=mario.six@gdsys.cc \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.