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 <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10429 a0bf4364-ded3-4de4-8d8a-66a801d63aff
This commit is contained in:
Tzafrir Cohen 2012-01-11 17:04:36 +00:00
parent a2a695c742
commit 4ff781c2ba
3 changed files with 22 additions and 17 deletions

View File

@ -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;
}

View File

@ -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]);

View File

@ -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 */
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 */
regnum,
do_subreg, /* use subreg */
subreg, /* subreg */
data_low, do_datah, /* use data_high */
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;