Re: [patch] Add support for picopower irq router

Randy Dunlap
2007-05-01T16:06:38Z

On Tue, 01 May 2007 12:40:22 +0300 Thomas Backlund wrote:

> arg, attachment. :(

[parts of patch copy/pasted here for comments]

+static int pirq_pico_get(struct pci_dev *router, struct pci_dev *dev, int pirq)
+{
+ outb(0x10+((pirq-1)>>1), 0x24);
+ return ((pirq-1)&1) ? (inb(0x26)>>4) : (inb(0x26)&0xf);
+}

Be more liberal with the spacebar. It helps readability. Like so:
(and see Documentation/CodingStyle)

+ outb(0x10 + ((pirq - 1) >> 1), 0x24);
+ return ((pirq -1 ) & 1) ? (inb(0x26) >> 4) : (inb(0x26) & 0xf);

Same for following functions.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+static int pirq_pico_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq)
+{
+ outb(0x10+((pirq-1)>>1), 0x24);
+ unsigned int x;
+ x = inb(0x26);

Data declarations must come before code.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+static __init int pico_router_probe(struct irq_router *r, struct pci_dev *router, u16 device)
+{
+ switch(device)

space after "switch".

+ {
+ case PCI_DEVICE_ID_PICOPOWER_PT86C523:

Don't indent cases. Put at same column as {.

BTW, this is all in CodingStyle.

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***