[patch 3/21] pcmcia: pd6729: cleanups

Dominik Brodowski linux at dominikbrodowski.de
Fri Dec 17 05:06:10 EST 2004


From:  Komuro <komurojun-mbn at nifty.com>

line length fixes and x = x | y => x |= y cleanups

Signed-off-by: Dominik Brodowski <linux at brodo.de>
---

 drivers/pcmcia/pd6729.c |   92 +++++++++++++++++++++++++++++-------------------
 1 files changed, 56 insertions(+), 36 deletions(-)

Index: 2.6.10-rc3/drivers/pcmcia/pd6729.c
===================================================================
--- 2.6.10-rc3.orig/drivers/pcmcia/pd6729.c	2004-12-17 10:05:28.141727870 +0100
+++ 2.6.10-rc3/drivers/pcmcia/pd6729.c	2004-12-17 10:06:04.569063241 +0100
@@ -43,7 +43,8 @@
 
 /* basic value read/write functions */
 
-static unsigned char indirect_read(struct pd6729_socket *socket, unsigned short reg)
+static unsigned char indirect_read(struct pd6729_socket *socket,
+				   unsigned short reg)
 {
 	unsigned long port;
 	unsigned char val;
@@ -59,7 +60,8 @@
 	return val;
 }
 
-static unsigned short indirect_read16(struct pd6729_socket *socket, unsigned short reg)
+static unsigned short indirect_read16(struct pd6729_socket *socket,
+				      unsigned short reg)
 {
 	unsigned long port;
 	unsigned short tmp;
@@ -78,7 +80,8 @@
 	return tmp;
 }
 
-static void indirect_write(struct pd6729_socket *socket, unsigned short reg, unsigned char value)
+static void indirect_write(struct pd6729_socket *socket, unsigned short reg,
+			   unsigned char value)
 {
 	unsigned long port;
 	unsigned long flags;
@@ -91,7 +94,8 @@
 	spin_unlock_irqrestore(&port_lock, flags);
 }
 
-static void indirect_setbit(struct pd6729_socket *socket, unsigned short reg, unsigned char mask)
+static void indirect_setbit(struct pd6729_socket *socket, unsigned short reg,
+			    unsigned char mask)
 {
 	unsigned long port;
 	unsigned char val;
@@ -108,7 +112,8 @@
 	spin_unlock_irqrestore(&port_lock, flags);
 }
 
-static void indirect_resetbit(struct pd6729_socket *socket, unsigned short reg, unsigned char mask)
+static void indirect_resetbit(struct pd6729_socket *socket, unsigned short reg,
+			      unsigned char mask)
 {
 	unsigned long port;
 	unsigned char val;
@@ -125,7 +130,8 @@
 	spin_unlock_irqrestore(&port_lock, flags);
 }
 
-static void indirect_write16(struct pd6729_socket *socket, unsigned short reg, unsigned short value)
+static void indirect_write16(struct pd6729_socket *socket, unsigned short reg,
+			     unsigned short value)
 {
 	unsigned long port;
 	unsigned char val;
@@ -160,7 +166,8 @@
 	while (1) {
 		loopcount++;
 		if (loopcount > 20) {
-			printk(KERN_ERR "pd6729: infinite eventloop in interrupt\n");
+			printk(KERN_ERR "pd6729: infinite eventloop "
+			       "in interrupt\n");
 			break;
 		}
 
@@ -182,14 +189,19 @@
 				dprintk("Card detected in socket %i!\n", i);
 			}
 
-			if (indirect_read(&socket[i], I365_INTCTL) & I365_PC_IOCARD) {
+			if (indirect_read(&socket[i], I365_INTCTL)
+						& I365_PC_IOCARD) {
 				/* For IO/CARDS, bit 0 means "read the card" */
-				events |= (csc & I365_CSC_STSCHG) ? SS_STSCHG : 0;
+				events |= (csc & I365_CSC_STSCHG)
+						? SS_STSCHG : 0;
 			} else {
 				/* Check for battery/ready events */
-				events |= (csc & I365_CSC_BVD1) ? SS_BATDEAD : 0;
-				events |= (csc & I365_CSC_BVD2) ? SS_BATWARN : 0;
-				events |= (csc & I365_CSC_READY) ? SS_READY : 0;
+				events |= (csc & I365_CSC_BVD1)
+						? SS_BATDEAD : 0;
+				events |= (csc & I365_CSC_BVD2)
+						? SS_BATWARN : 0;
+				events |= (csc & I365_CSC_READY)
+						? SS_READY : 0;
 			}
 
 			if (events) {
@@ -216,7 +228,8 @@
 
 static int pd6729_get_status(struct pcmcia_socket *sock, u_int *value)
 {
-	struct pd6729_socket *socket = container_of(sock, struct pd6729_socket, socket);
+	struct pd6729_socket *socket
+			= container_of(sock, struct pd6729_socket, socket);
 	unsigned int status;
 	unsigned int data;
 	struct pd6729_socket *t;
@@ -265,7 +278,8 @@
 
 static int pd6729_get_socket(struct pcmcia_socket *sock, socket_state_t *state)
 {
-	struct pd6729_socket *socket = container_of(sock, struct pd6729_socket, socket);
+	struct pd6729_socket *socket
+			= container_of(sock, struct pd6729_socket, socket);
 	unsigned char reg, vcc, vpp;
 
 	state->flags    = 0;
@@ -342,7 +356,8 @@
 
 static int pd6729_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
 {
-	struct pd6729_socket *socket = container_of(sock, struct pd6729_socket, socket);
+	struct pd6729_socket *socket
+			= container_of(sock, struct pd6729_socket, socket);
 	unsigned char reg;
 
 	/* First, set the global controller options */
@@ -354,9 +369,9 @@
 	reg = 0;
  	/* The reset bit has "inverse" logic */
 	if (!(state->flags & SS_RESET))
-		reg = reg | I365_PC_RESET;
+		reg |= I365_PC_RESET;
 	if (state->flags & SS_IOCARD)
-		reg = reg | I365_PC_IOCARD;
+		reg |= I365_PC_IOCARD;
 
 	/* IGENC, Interrupt and General Control Register */
 	indirect_write(socket, I365_INTCTL, reg);
@@ -390,7 +405,8 @@
 		indirect_resetbit(socket, PD67_MISC_CTL_1, PD67_MC1_VCC_3V);
 		break;
 	default:
-		dprintk("pd6729: pd6729_set_socket called with invalid VCC power value: %i\n",
+		dprintk("pd6729: pd6729_set_socket called with "
+				"invalid VCC power value: %i\n",
 			state->Vcc);
 		return -EINVAL;
 	}
@@ -452,9 +468,11 @@
 	return 0;
 }
 
-static int pd6729_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io)
+static int pd6729_set_io_map(struct pcmcia_socket *sock,
+			     struct pccard_io_map *io)
 {
-	struct pd6729_socket *socket = container_of(sock, struct pd6729_socket, socket);
+	struct pd6729_socket *socket
+			= container_of(sock, struct pd6729_socket, socket);
 	unsigned char map, ioctl;
 
 	map = io->map;
@@ -469,7 +487,8 @@
 	if (indirect_read(socket, I365_ADDRWIN) & I365_ENA_IO(map))
 		indirect_resetbit(socket, I365_ADDRWIN, I365_ENA_IO(map));
 
-/*	dprintk("set_io_map: Setting range to %x - %x\n", io->start, io->stop);*/
+	/* dprintk("set_io_map: Setting range to %x - %x\n",
+	   io->start, io->stop);*/
 
 	/* write the new values */
 	indirect_write16(socket, I365_IO(map)+I365_W_START, io->start);
@@ -490,9 +509,11 @@
 	return 0;
 }
 
-static int pd6729_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map *mem)
+static int pd6729_set_mem_map(struct pcmcia_socket *sock,
+			      struct pccard_mem_map *mem)
 {
-	struct pd6729_socket *socket = container_of(sock, struct pd6729_socket, socket);
+	struct pd6729_socket *socket
+			 = container_of(sock, struct pd6729_socket, socket);
 	unsigned short base, i;
 	unsigned char map;
 
@@ -504,8 +525,6 @@
 
 	if ((mem->res->start > mem->res->end) || (mem->speed > 1000)) {
 		printk("pd6729_set_mem_map: invalid address / speed");
-		/* printk("invalid mem map for socket %i : %lx to %lx with a start of %x\n",
-			 sock, mem->res->start, mem->res->end, mem->card_start); */
 		return -EINVAL;
 	}
 
@@ -551,11 +570,11 @@
 	if (mem->flags & MAP_WRPROT)
 		i |= I365_MEM_WRPROT;
 	if (mem->flags & MAP_ATTRIB) {
-/*		dprintk("requesting attribute memory for socket %i\n",
+		/* dprintk("requesting attribute memory for socket %i\n",
 			socket->number);*/
 		i |= I365_MEM_REG;
 	} else {
-/*		dprintk("requesting normal memory for socket %i\n",
+		/* dprintk("requesting normal memory for socket %i\n",
 			socket->number);*/
 	}
 	indirect_write16(socket, base + I365_W_OFF, i);
@@ -604,13 +623,15 @@
 	.set_mem_map		= pd6729_set_mem_map,
 };
 
-static int __devinit pd6729_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
+static int __devinit pd6729_pci_probe(struct pci_dev *dev,
+				      const struct pci_device_id *id)
 {
 	int i, j, ret;
 	char configbyte;
 	struct pd6729_socket *socket;
 
-	socket = kmalloc(sizeof(struct pd6729_socket) * MAX_SOCKETS, GFP_KERNEL);
+	socket = kmalloc(sizeof(struct pd6729_socket) * MAX_SOCKETS,
+			 GFP_KERNEL);
 	if (!socket)
 		return -ENOMEM;
 
@@ -619,13 +640,11 @@
 	if ((ret = pci_enable_device(dev)))
 		goto err_out_free_mem;
 
-	printk(KERN_INFO "pd6729: Cirrus PD6729 PCI to PCMCIA Bridge at 0x%lx on irq %d\n",
-		pci_resource_start(dev, 0), dev->irq);
-	printk(KERN_INFO "pd6729: configured as a %d socket device.\n", MAX_SOCKETS);
+	printk(KERN_INFO "pd6729: Cirrus PD6729 PCI to PCMCIA Bridge "
+		"at 0x%lx on irq %d\n",	pci_resource_start(dev, 0), dev->irq);
  	/*
-	 * Since we have no memory BARs some firmware we may not
-	 * have had PCI_COMMAND_MEM enabled, yet the device needs
-	 * it.
+	 * Since we have no memory BARs some firmware may not
+	 * have had PCI_COMMAND_MEMORY enabled, yet the device needs it.
 	 */
 	pci_read_config_byte(dev, PCI_COMMAND, &configbyte);
 	if (!(configbyte & PCI_COMMAND_MEMORY)) {
@@ -666,7 +685,8 @@
 	for (i = 0; i < MAX_SOCKETS; i++) {
 		ret = pcmcia_register_socket(&socket[i].socket);
 		if (ret) {
-			printk(KERN_INFO "pd6729: pcmcia_register_socket failed.\n");
+			printk(KERN_INFO "pd6729: pcmcia_register_socket "
+					       "failed.\n");
 			for (j = 0; j < i ; j++)
 				pcmcia_unregister_socket(&socket[j].socket);
 			goto err_out_free_res2;



More information about the linux-pcmcia mailing list