diff options
author | Guillaume Knispel <gknispel@proformatique.com> | 2010-10-05 17:01:40 +0200 |
---|---|---|
committer | Guillaume Knispel <gknispel@proformatique.com> | 2010-10-05 17:01:40 +0200 |
commit | 4c7b70f063226d5b1c70c314db20bc71ba10abc2 (patch) | |
tree | eb9c877d8480727753f377303670a35124168955 /xhfc | |
parent | 9625f4d88d833be6c8c294d0f85452ce4c1c1c55 (diff) |
use proper Linux indentation
Diffstat (limited to 'xhfc')
-rw-r--r-- | xhfc/xhfc.c | 56 | ||||
-rw-r--r-- | xhfc/xhfc_leb.h | 4 | ||||
-rw-r--r-- | xhfc/xhfc_tdm_iface.h | 2 |
3 files changed, 31 insertions, 31 deletions
diff --git a/xhfc/xhfc.c b/xhfc/xhfc.c index 702d75c..e2c142a 100644 --- a/xhfc/xhfc.c +++ b/xhfc/xhfc.c @@ -196,16 +196,16 @@ sprintf(buf, "%s(fifo %d): flen=%d, " \ #define DEFINE_GET_LEN(F_or_Z) \ static inline int \ -get_ ## F_or_Z ## len(struct xhfc* x) { \ +get_ ## F_or_Z ## len(struct xhfc* x) { \ u8 _1, _2; \ -int len; \ +int len; \ \ _1 = read_xhfc(x, A_ ## F_or_Z ## 1); \ _2 = read_xhfc(x, A_ ## F_or_Z ## 2); \ len = _1 - _2; \ \ -if(len < 0) \ - len += \ +if (len < 0) \ + len += \ (XHFC_ ## F_or_Z ## MAX - \ XHFC_ ## F_or_Z ## MIN) + 1; \ \ @@ -276,7 +276,7 @@ void xhfc_config_b_chan_on_fifo(struct xhfc *x, int fifo, int slot, int directio void xhfc_config_data_flow(struct xhfc* x) { int i; - for(i = 0; i < SPANS_PER_CHIP; i++) { + for (i = 0; i < SPANS_PER_CHIP; i++) { /* HFC chan, PCM slot, direction */ xhfc_config_b_chan_on_fifo(x, i * 4 + 0, i * 2 + 0, TRANSMIT); xhfc_config_b_chan_on_fifo(x, i * 4 + 0, i * 2 + 0, RECEIVE); @@ -353,11 +353,11 @@ static int hdlc_rx_frame(struct xhfc_span *xhfc_span) debug_fz(x, fifo, __func__, debugbuf); - if(!flen && !zlen) { - if(DBG_VERBOSE_HDLC && DBG_SPANFILTER) + if (!flen && !zlen) { + if (DBG_VERBOSE_HDLC && DBG_SPANFILTER) xhfc_info(x, "%s, nothing to receive (%ld).\n", debugbuf, xhfc_span->non_rx_cnt); xhfc_span->non_rx_cnt++; - if(DBG_HDLC && DBG_SPANFILTER && 0 == xhfc_span->non_rx_cnt % 2000) + if (DBG_HDLC && DBG_SPANFILTER && 0 == xhfc_span->non_rx_cnt % 2000) xhfc_info(x, "%s(fifo %d): Received nothing for %ld seconds.\n", __func__, fifo, xhfc_span->non_rx_cnt / 2000); return 0; @@ -420,7 +420,7 @@ static int hdlc_rx_frame(struct xhfc_span *xhfc_span) } while (zleft > 0); /* Frame received, increment F2 */ - if(flen) + if (flen) xhfc_inc_f(x); /* If this channel is not configured with a signalling span we don't @@ -592,12 +592,12 @@ irqreturn_t xhfc_interrupt(int irq, void *dev_id, struct pt_regs* ptregs) struct xhfc_span* s = &xhfc->spans[i]; - if(s->running && s->sigchan) { - while(hdlc_rx_frame(s)) + if (s->running && s->sigchan) { + while (hdlc_rx_frame(s)) break; - if(atomic_read(&s->hdlc_pending)) - while(hdlc_tx_frame(s)) + if (atomic_read(&s->hdlc_pending)) + while (hdlc_tx_frame(s)) break; #if 0 // Why is this commented out? XXX dahdi_receive(&s->span); @@ -611,7 +611,7 @@ irqreturn_t xhfc_interrupt(int irq, void *dev_id, struct pt_regs* ptregs) r_su_irq = read_xhfc(xhfc, R_SU_IRQ); for (i = 0; i < ARRAY_SIZE(xhfc->spans); i++) - if(r_su_irq & (1 << i) || 2 == xhfc->ticks /* bootstrap XXX*/) + if (r_su_irq & (1 << i) || 2 == xhfc->ticks /* bootstrap XXX*/) hfc_handle_state(&xhfc->spans[i]); hfc_update_st_timers(xhfc); @@ -666,7 +666,7 @@ static void enable_interrupts(struct xhfc * xhfc) int xhfc_collect_chip_id(struct xhfc * xhfc) { u8 chip_id = read_xhfc(xhfc, R_CHIP_ID); - switch(chip_id) { + switch (chip_id) { case CHIP_ID_1SU: case CHIP_ID_2SU: case CHIP_ID_2S4U: @@ -717,7 +717,7 @@ void xhfc_init_and_configure(struct xhfc* x) /* "stage 2" */ xhfc_config_pcm(x, XHFC_PCM_MASTER); - for(i = 0; i < SPANS_PER_CHIP; i++) + for (i = 0; i < SPANS_PER_CHIP; i++) xhfc_config_st(x, x->spans[i].port, x->spans[i].nt); /* No we need to setup the flow controller and stuff */ @@ -729,7 +729,7 @@ int xhfc_span_startup(struct dahdi_span* span) { struct xhfc_span *xhfc_span = container_of(span, struct xhfc_span, span); struct xhfc *x = xhfc_span->xhfc; - if(!x->running) + if (!x->running) enable_interrupts(x); xhfc_span->running = 1; @@ -850,7 +850,7 @@ int xhfc_chanconfig(struct dahdi_chan *chan, int sigtype) static int xhfc_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long data) { - switch(cmd) { + switch (cmd) { default: return -ENOTTY; } @@ -1032,7 +1032,7 @@ int __devinit xhfc_init_one(struct pci_dev *pdev, xhfc_hard_reset(); - if(exit_after_reset) { + if (exit_after_reset) { rc = -EINVAL; goto exit_after_reset; } @@ -1055,7 +1055,7 @@ int __devinit xhfc_init_one(struct pci_dev *pdev, IRQ_TLP_GPIO_30, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW); - if(rc < 0) + if (rc < 0) goto err_acpi_register; pi->xhfc.r_pcm_md0 = 0; @@ -1087,8 +1087,8 @@ int __devinit xhfc_init_one(struct pci_dev *pdev, xhfc_init_and_configure(&pi->xhfc); - for(span = 0; span < SPANS_PER_CHIP; span++) - if(dahdi_register(&pi->xhfc.spans[span].span, /*prefmaster*/ 0)) { + for (span = 0; span < SPANS_PER_CHIP; span++) + if (dahdi_register(&pi->xhfc.spans[span].span, /*prefmaster*/ 0)) { printk(KERN_WARNING "%s %s: couldn't register spans.\n", pi->name, __FUNCTION__); rc = -EINVAL; goto err_dahdi_register; @@ -1099,7 +1099,7 @@ int __devinit xhfc_init_one(struct pci_dev *pdev, return 0; err_dahdi_register: - for(; span >= 0; span--) + for (; span >= 0; span--) dahdi_unregister(&pi->xhfc.spans[span].span); err_request_irq: err_collect_chip_id: @@ -1126,11 +1126,11 @@ void __devexit xhfc_remove_one(struct pci_dev *pdev) pi = pci_get_drvdata(pdev); - if(DBG) + if (DBG) printk(KERN_INFO "%s %s: removing card\n", pi->name, __FUNCTION__); - for(i = 0; i < SPANS_PER_CHIP; i++) + for (i = 0; i < SPANS_PER_CHIP; i++) dahdi_unregister(&pi->xhfc.spans[i].span); release_card_irq(pi); @@ -1152,7 +1152,7 @@ void __devexit xhfc_remove_one(struct pci_dev *pdev) void xhfc_shutdown(struct pci_dev *pdev) { - if(DBG) + if (DBG) printk(KERN_DEBUG "%s: Au revoir.\n", __FUNCTION__); } @@ -1163,7 +1163,7 @@ static int __init xhfc_init(void) { int err; - if(DBG) + if (DBG) printk(KERN_INFO DRIVER_NAME " driver Rev. %s \n", xhfc_rev); @@ -1182,7 +1182,7 @@ static int __init xhfc_init(void) static void __exit xhfc_cleanup(void) { pci_unregister_driver(&xhfc_driver); - if(DBG) + if (DBG) printk(KERN_INFO "%s: driver removed\n", __FUNCTION__); } diff --git a/xhfc/xhfc_leb.h b/xhfc/xhfc_leb.h index 08bd0ed..0c1bfb8 100644 --- a/xhfc/xhfc_leb.h +++ b/xhfc/xhfc_leb.h @@ -55,12 +55,12 @@ static inline void write_xhfc(struct xhfc * xhfc, u8 reg_addr, u8 value) #ifdef DEBUG #define read_xhfc(x, reg) ({ \ u8 _res = read_xhfc(x, reg); \ - if(DBG_REGS) printk(KERN_INFO #reg " -> %02x\n", _res); \ + if (DBG_REGS) printk(KERN_INFO #reg " -> %02x\n", _res);\ _res; \ }) #define write_xhfc(x, reg, val) ({ \ - if(DBG_REGS) printk(KERN_INFO #reg " <- %02x\n", val); \ + if (DBG_REGS) printk(KERN_INFO #reg " <- %02x\n", val); \ write_xhfc(x, reg, val); \ }) #endif diff --git a/xhfc/xhfc_tdm_iface.h b/xhfc/xhfc_tdm_iface.h index 50cc0dc..9314d14 100644 --- a/xhfc/xhfc_tdm_iface.h +++ b/xhfc/xhfc_tdm_iface.h @@ -26,7 +26,7 @@ void xhfc_rxtx(void); /* * And I guess its code would be something like * - for(i = 0; i < NB_PORT; i++) { + for (i = 0; i < NB_PORT; i++) { dahdi_ec_span(spans[i]); dahdi_write(spans[i]); dahdi_read(spans[i]); |