linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Geis <simon.geis@fau.de>
To: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Simon Geis <simon.geis@fau.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Colin Ian King <colin.king@canonical.com>,
	Adam Zerella <adam.zerella@gmail.com>,
	linux-kernel@vger.kernel.org, linux-kernel@i4.cs.fau.de,
	Lukas Panzer <lukas.panzer@fau.de>
Subject: [PATCH v2 05/10] PCMCIA/i82092: change code indentation
Date: Tue, 10 Dec 2019 12:43:30 +0100	[thread overview]
Message-ID: <20191210114333.12239-6-simon.geis@fau.de> (raw)
In-Reply-To: <20191210114333.12239-1-simon.geis@fau.de>

Align switch and case labels in order to maintain
the Linux kernel coding style and to improve readability.
For the same reason, change the indentation of an if-statement.

Co-developed-by: Lukas Panzer <lukas.panzer@fau.de>
Signed-off-by: Lukas Panzer <lukas.panzer@fau.de>
Signed-off-by: Simon Geis <simon.geis@fau.de>

---
 drivers/pcmcia/i82092.c | 128 ++++++++++++++++++++--------------------
 1 file changed, 64 insertions(+), 64 deletions(-)

diff --git a/drivers/pcmcia/i82092.c b/drivers/pcmcia/i82092.c
index b9366adfe087..a2be520bc3d3 100644
--- a/drivers/pcmcia/i82092.c
+++ b/drivers/pcmcia/i82092.c
@@ -82,22 +82,22 @@ static int i82092aa_pci_probe(struct pci_dev *dev, const struct pci_device_id *i
 
 	pci_read_config_byte(dev, 0x40, &configbyte);  /* PCI Configuration Control */
 	switch (configbyte&6) {
-		case 0:
-			socket_count = 2;
-			break;
-		case 2:
-			socket_count = 1;
-			break;
-		case 4:
-		case 6:
-			socket_count = 4;
-			break;
-
-		default:
-			dev_err(&dev->dev,
-				"i82092aa: Oops, you did something we didn't think of.\n");
-			ret = -EIO;
-			goto err_out_disable;
+	case 0:
+		socket_count = 2;
+		break;
+	case 2:
+		socket_count = 1;
+		break;
+	case 4:
+	case 6:
+		socket_count = 4;
+		break;
+
+	default:
+		dev_err(&dev->dev,
+			"i82092aa: Oops, you did something we didn't think of.\n");
+		ret = -EIO;
+		goto err_out_disable;
 	}
 	dev_info(&dev->dev, "i82092aa: configured as a %d socket device.\n",
 		 socket_count);
@@ -502,45 +502,45 @@ static int i82092aa_set_socket(struct pcmcia_socket *socket, socket_state_t *sta
 	}
 
 	switch (state->Vcc) {
-		case 0:
-			break;
-		case 50:
-			dev_info(&sock_info->dev->dev,
-				 "setting voltage to Vcc to 5V on socket %i\n",
-				 sock);
-			reg |= I365_VCC_5V;
-			break;
-		default:
-			dev_err(&sock_info->dev->dev,
-				"i82092aa: %s called with invalid VCC power value: %i",
-				__func__, state->Vcc);
-			leave("i82092aa_set_socket");
-			return -EINVAL;
+	case 0:
+		break;
+	case 50:
+		dev_info(&sock_info->dev->dev,
+			 "setting voltage to Vcc to 5V on socket %i\n",
+			 sock);
+		reg |= I365_VCC_5V;
+		break;
+	default:
+		dev_err(&sock_info->dev->dev,
+			"i82092aa: %s called with invalid VCC power value: %i",
+			__func__, state->Vcc);
+		leave("i82092aa_set_socket");
+		return -EINVAL;
 	}
 
 	switch (state->Vpp) {
-		case 0:
-			dev_info(&sock_info->dev->dev,
-				 "not setting Vpp on socket %i\n",
-				 sock);
-			break;
-		case 50:
-			dev_info(&sock_info->dev->dev,
-				 "setting Vpp to 5.0 for socket %i\n",
-				 sock);
-			reg |= I365_VPP1_5V | I365_VPP2_5V;
-			break;
-		case 120:
-			dev_info(&sock_info->dev->dev,
-				 "setting Vpp to 12.0\n");
-			reg |= I365_VPP1_12V | I365_VPP2_12V;
-			break;
-		default:
-			dev_err(&sock_info->dev->dev,
-				"i82092aa: %s called with invalid VPP power value: %i",
-				__func__, state->Vcc);
-			leave("i82092aa_set_socket");
-			return -EINVAL;
+	case 0:
+		dev_info(&sock_info->dev->dev,
+			 "not setting Vpp on socket %i\n",
+			 sock);
+		break;
+	case 50:
+		dev_info(&sock_info->dev->dev,
+			 "setting Vpp to 5.0 for socket %i\n",
+			 sock);
+		reg |= I365_VPP1_5V | I365_VPP2_5V;
+		break;
+	case 120:
+		dev_info(&sock_info->dev->dev,
+			 "setting Vpp to 12.0\n");
+		reg |= I365_VPP1_12V | I365_VPP2_12V;
+		break;
+	default:
+		dev_err(&sock_info->dev->dev,
+			"i82092aa: %s called with invalid VPP power value: %i",
+			__func__, state->Vcc);
+		leave("i82092aa_set_socket");
+		return -EINVAL;
 	}
 
 	if (reg != indirect_read(sock, I365_POWER)) /* only write if changed */
@@ -679,17 +679,17 @@ static int i82092aa_set_mem_map(struct pcmcia_socket *socket, struct pccard_mem_
 
 	i = (region.end >> 12) & 0x0fff;
 	switch (to_cycles(mem->speed)) {
-		case 0:
-			break;
-		case 1:
-			i |= I365_MEM_WS0;
-			break;
-		case 2:
-			i |= I365_MEM_WS1;
-			break;
-		default:
-			i |= I365_MEM_WS1 | I365_MEM_WS0;
-			break;
+	case 0:
+		break;
+	case 1:
+		i |= I365_MEM_WS0;
+		break;
+	case 2:
+		i |= I365_MEM_WS1;
+		break;
+	default:
+		i |= I365_MEM_WS1 | I365_MEM_WS0;
+		break;
 	}
 
 	indirect_write16(sock, base+I365_W_STOP, i);
@@ -731,7 +731,7 @@ static void i82092aa_module_exit(void)
 	enter("i82092aa_module_exit");
 	pci_unregister_driver(&i82092aa_pci_driver);
 	if (sockets[0].io_base > 0)
-			 release_region(sockets[0].io_base, 2);
+		release_region(sockets[0].io_base, 2);
 	leave("i82092aa_module_exit");
 }
 
-- 
2.20.1


  parent reply	other threads:[~2019-12-10 11:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-10 11:43 [PATCH v2 00/10] PCMCIA/i82092: Fix style issues in i82092.c Simon Geis
2019-12-10 11:43 ` [PATCH v2 01/10] PCMCIA/i82092: use dev_<level> instead of printk Simon Geis
2019-12-10 12:49   ` Greg Kroah-Hartman
2019-12-10 13:25     ` Dominik Brodowski
2019-12-10 11:43 ` [PATCH v2 02/10] PCMCIA/i82092: add/remove spaces to improve readability Simon Geis
2019-12-10 11:43 ` [PATCH v2 03/10] PCMCIA/i82092: remove braces around single statement blocks Simon Geis
2019-12-10 11:43 ` [PATCH v2 04/10] PCMCIA/i82092: insert blank line after declarations Simon Geis
2019-12-10 11:43 ` Simon Geis [this message]
2019-12-10 11:43 ` [PATCH v2 06/10] PCMCIA/i82092: move assignment out of if condition Simon Geis
2019-12-10 11:43 ` [PATCH v2 07/10] PCMCIA/i82092: shorten the lines with over 80 characters Simon Geis
2019-12-10 11:43 ` [PATCH v2 08/10] PCMCIA/i82092: include <linux/io.h> instead of <asm/io.h> Simon Geis
2019-12-10 11:43 ` [PATCH v2 09/10] PCMCIA/i82092: improve enter/leave macro Simon Geis
2019-12-10 12:51   ` Greg Kroah-Hartman
2019-12-10 11:43 ` [PATCH v2 10/10] PCMCIA/i82092: remove #if 0 block Simon Geis
2019-12-12 14:27 ` [PATCH v2 00/10] PCMCIA/i82092: Fix style issues in i82092.c Dominik Brodowski

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=20191210114333.12239-6-simon.geis@fau.de \
    --to=simon.geis@fau.de \
    --cc=adam.zerella@gmail.com \
    --cc=colin.king@canonical.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@i4.cs.fau.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=lukas.panzer@fau.de \
    --cc=tglx@linutronix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).