Re: [PATCH kernel 2.6.34-rc1-git7] pd6729: Coding Style fixes

2010-03-20 Thread Dominik Brodowski
Applied, thanks!

Dominik

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


[PATCH kernel 2.6.34-rc1-git7] pd6729: Coding Style fixes

2010-03-19 Thread Komuro


Signed-off-by: Komuro 

---

--- linux-2.6.34-rc1/drivers/pcmcia/pd6729.c.orig2  2010-03-14 
05:45:04.0 +0900
+++ linux-2.6.34-rc1/drivers/pcmcia/pd6729.c2010-03-19 06:24:16.0 
+0900
@@ -14,13 +14,13 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
 #include 
 
 #include 
-#include 
 
 #include "pd6729.h"
 #include "i82365.h"
@@ -222,9 +222,9 @@ static irqreturn_t pd6729_interrupt(int 
? SS_READY : 0;
}
 
-   if (events) {
+   if (events)
pcmcia_parse_events(&socket[i].socket, events);
-   }
+
active |= events;
}
 
@@ -256,9 +256,8 @@ static int pd6729_get_status(struct pcmc
status = indirect_read(socket, I365_STATUS);
*value = 0;
 
-   if ((status & I365_CS_DETECT) == I365_CS_DETECT) {
+   if ((status & I365_CS_DETECT) == I365_CS_DETECT)
*value |= SS_DETECT;
-   }
 
/*
 * IO cards have a different meaning of bits 0,1
@@ -308,7 +307,7 @@ static int pd6729_set_socket(struct pcmc
socket->card_irq = state->io_irq;
 
reg = 0;
-   /* The reset bit has "inverse" logic */
+   /* The reset bit has "inverse" logic */
if (!(state->flags & SS_RESET))
reg |= I365_PC_RESET;
if (state->flags & SS_IOCARD)
@@ -380,7 +379,7 @@ static int pd6729_set_socket(struct pcmc
indirect_write(socket, I365_POWER, reg);
 
if (irq_mode == 1) {
-/* all interrupts are to be done as PCI interrupts */
+   /* all interrupts are to be done as PCI interrupts */
data = PD67_EC1_INV_MGMT_IRQ | PD67_EC1_INV_CARD_IRQ;
} else
data = 0;
@@ -391,9 +390,9 @@ static int pd6729_set_socket(struct pcmc
/* Enable specific interrupt events */
 
reg = 0x00;
-   if (state->csc_mask & SS_DETECT) {
+   if (state->csc_mask & SS_DETECT)
reg |= I365_CSC_DETECT;
-   }
+
if (state->flags & SS_IOCARD) {
if (state->csc_mask & SS_STSCHG)
reg |= I365_CSC_STSCHG;
@@ -450,9 +449,12 @@ static int pd6729_set_io_map(struct pcmc
 
ioctl = indirect_read(socket, I365_IOCTL) & ~I365_IOCTL_MASK(map);
 
-   if (io->flags & MAP_0WS) ioctl |= I365_IOCTL_0WS(map);
-   if (io->flags & MAP_16BIT) ioctl |= I365_IOCTL_16BIT(map);
-   if (io->flags & MAP_AUTOSZ) ioctl |= I365_IOCTL_IOCS16(map);
+   if (io->flags & MAP_0WS)
+   ioctl |= I365_IOCTL_0WS(map);
+   if (io->flags & MAP_16BIT)
+   ioctl |= I365_IOCTL_16BIT(map);
+   if (io->flags & MAP_AUTOSZ)
+   ioctl |= I365_IOCTL_IOCS16(map);
 
indirect_write(socket, I365_IOCTL, ioctl);
 
@@ -497,7 +499,7 @@ static int pd6729_set_mem_map(struct pcm
 
/* write the stop address */
 
-   i= (mem->res->end >> 12) & 0x0fff;
+   i = (mem->res->end >> 12) & 0x0fff;
switch (to_cycles(mem->speed)) {
case 0:
break;
@@ -563,7 +565,7 @@ static int pd6729_init(struct pcmcia_soc
 
 /* the pccard structure and its functions */
 static struct pccard_operations pd6729_operations = {
-   .init   = pd6729_init,
+   .init   = pd6729_init,
.get_status = pd6729_get_status,
.set_socket = pd6729_set_socket,
.set_io_map = pd6729_set_io_map,
@@ -578,8 +580,13 @@ static irqreturn_t pd6729_test(int irq, 
 
 static int pd6729_check_irq(int irq)
 {
-   if (request_irq(irq, pd6729_test, IRQF_PROBE_SHARED, "x", pd6729_test)
-   != 0) return -1;
+   int ret;
+
+   ret = request_irq(irq, pd6729_test, IRQF_PROBE_SHARED, "x",
+ pd6729_test);
+   if (ret)
+   return -1;
+
free_irq(irq, pd6729_test);
return 0;
 }
@@ -591,7 +598,7 @@ static u_int __devinit pd6729_isa_scan(v
 
if (irq_mode == 1) {
printk(KERN_INFO "pd6729: PCI card interrupts, "
-   "PCI status changes\n");
+  "PCI status changes\n");
return 0;
}
 
@@ -607,9 +614,10 @@ static u_int __devinit pd6729_isa_scan(v
if (mask & (1dev, "failed to enable pci_device.\n");
goto err_out_free_mem;
+   }
 
if (!pci_resource_start(dev, 0)) {
dev_warn(&dev->dev, "refusing to load the driver as the "
@@ -639,7 +652,7 @@ static int __devinit pd6729_pci_probe(st
dev_info(&dev->dev, "Cirrus PD6729 PCI to PCMC