From 255867a2f3ef00bb35d221be49ae55ef68b035c7 Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Wed, 11 Jan 2012 17:04:36 +0000 Subject: xpp: fix "non-const" index, right header, indent Synchronize some changes from out internal tree: * Fix a few of the places where indent did a lousy job. * sparse did not like using the const MAX_ARGS as an index. Make it a define. * Incorrect header included in card_fxs.c (doh!). * One more funciton to statify. Signed-off-by: Tzafrir Cohen git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10429 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/xpp/card_bri.c | 2 +- drivers/dahdi/xpp/card_fxs.c | 13 +++++++------ drivers/dahdi/xpp/card_global.c | 24 ++++++++++++++---------- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/drivers/dahdi/xpp/card_bri.c b/drivers/dahdi/xpp/card_bri.c index 30598f2..f9b6d8e 100644 --- a/drivers/dahdi/xpp/card_bri.c +++ b/drivers/dahdi/xpp/card_bri.c @@ -1315,7 +1315,7 @@ static int BRI_timing_priority(xpd_t *xpd) return -ENOENT; } -int BRI_echocancel_timeslot(xpd_t *xpd, int pos) +static int BRI_echocancel_timeslot(xpd_t *xpd, int pos) { return xpd->addr.subunit * 4 + pos; } diff --git a/drivers/dahdi/xpp/card_fxs.c b/drivers/dahdi/xpp/card_fxs.c index f894d6a..081e2d9 100644 --- a/drivers/dahdi/xpp/card_fxs.c +++ b/drivers/dahdi/xpp/card_fxs.c @@ -27,7 +27,7 @@ #include "xpd.h" #include "xproto.h" #include "xpp_dahdi.h" -#include "card_fxo.h" +#include "card_fxs.h" #include "dahdi_debug.h" #include "xbus-core.h" @@ -1221,10 +1221,11 @@ static void detect_vmwi(xpd_t *xpd) priv = xpd->priv; BUG_ON(!priv); ignore_mask = - PHONEDEV(xpd).offhook_state | ~(PHONEDEV(xpd). - oht_pcm_pass) | ~(priv-> - search_fsk_pattern) - | PHONEDEV(xpd).digital_inputs | PHONEDEV(xpd).digital_outputs; + PHONEDEV(xpd).offhook_state | + ~(PHONEDEV(xpd).oht_pcm_pass) | + ~(priv->search_fsk_pattern) | + PHONEDEV(xpd).digital_inputs | + PHONEDEV(xpd).digital_outputs; for_each_line(xpd, i) { struct dahdi_chan *chan = XPD_CHAN(xpd, i); __u8 *writechunk = chan->writechunk; @@ -1235,7 +1236,7 @@ static void detect_vmwi(xpd_t *xpd) if (writechunk[0] != 0x7F && writechunk[0] != 0) { int j; - LINE_DBG(GENERAL, xpd, pos, "MSG:"); + LINE_DBG(GENERAL, xpd, i, "MSG:"); for (j = 0; j < DAHDI_CHUNKSIZE; j++) { if (debug) printk(" %02X", writechunk[j]); diff --git a/drivers/dahdi/xpp/card_global.c b/drivers/dahdi/xpp/card_global.c index 8918e5c..8feb00a 100644 --- a/drivers/dahdi/xpp/card_global.c +++ b/drivers/dahdi/xpp/card_global.c @@ -258,21 +258,26 @@ static int execute_chip_command(xpd_t *xpd, const int argc, char *argv[]) goto out; } #if 0 - XPD_DBG(REGS, xpd, "portno=%d writing=%d regnum=%d do_subreg=%d subreg=%d dataL=%d do_datah=%d dataH=%d\n", portno, /* portno */ - writing, /* writing */ - regnum, do_subreg, /* use subreg */ - subreg, /* subreg */ - data_low, do_datah, /* use data_high */ + XPD_DBG(REGS, xpd, + "portno=%d writing=%d regnum=%d do_subreg=%d subreg=%d dataL=%d do_datah=%d dataH=%d\n", + portno, /* portno */ + writing, /* writing */ + regnum, + do_subreg, /* use subreg */ + subreg, /* subreg */ + data_low, + do_datah, /* use data_high*/ data_high); #endif - ret = - xpp_register_request(xpd->xbus, xpd, portno, writing, regnum, - do_subreg, subreg, data_low, do_datah, - data_high, 1); + ret = xpp_register_request(xpd->xbus, xpd, portno, + writing, regnum, do_subreg, subreg, + data_low, do_datah, data_high, 1); out: return ret; } +#define MAX_ARGS 10 + int parse_chip_command(xpd_t *xpd, char *cmdline) { xbus_t *xbus; @@ -280,7 +285,6 @@ int parse_chip_command(xpd_t *xpd, char *cmdline) __u8 buf[MAX_PROC_WRITE]; char *str; char *p; - static const int MAX_ARGS = 10; char *argv[MAX_ARGS + 1]; int argc; int i; -- cgit v1.2.3