xpp: style - remove extra braces
Signed-off-by: Oron Peled <oron.peled@xorcom.com> Acked-By: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10438 a0bf4364-ded3-4de4-8d8a-66a801d63aff
This commit is contained in:
committed by
Tzafrir Cohen
parent
2f03aa8bcb
commit
8228de4d11
@@ -520,9 +520,8 @@ static void bri_hdlc_hard_xmit(struct dahdi_chan *chan)
|
||||
priv = xpd->priv;
|
||||
BUG_ON(!priv);
|
||||
dchan = XPD_CHAN(xpd, 2);
|
||||
if (dchan == chan) {
|
||||
if (dchan == chan)
|
||||
atomic_inc(&priv->hdlc_pending);
|
||||
}
|
||||
}
|
||||
|
||||
static int send_dchan_frame(xpd_t *xpd, xframe_t *xframe, bool is_eof)
|
||||
@@ -1199,9 +1198,8 @@ static void BRI_card_pcm_recompute(xpd_t *xpd, xpp_line_t dont_care)
|
||||
line_count += 2;
|
||||
}
|
||||
/* subunits have fake pcm_len and wanted_pcm_mask */
|
||||
if (i > 0) {
|
||||
if (i > 0)
|
||||
update_wanted_pcm_mask(sub_xpd, lines, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
@@ -1417,9 +1415,8 @@ static void su_new_state(xpd_t *xpd, __u8 reg_x30)
|
||||
return;
|
||||
}
|
||||
new_state.reg = reg_x30;
|
||||
if (new_state.bits.v_su_t2_exp) {
|
||||
if (new_state.bits.v_su_t2_exp)
|
||||
XPD_NOTICE(xpd, "T2 Expired\n");
|
||||
}
|
||||
priv->reg30_ticks = 0;
|
||||
priv->reg30_good = 1;
|
||||
if (priv->state_register.bits.v_su_sta == new_state.bits.v_su_sta)
|
||||
@@ -1548,9 +1545,8 @@ static int BRI_card_register_reply(xbus_t *xbus, xpd_t *xpd, reg_cmd_t *info)
|
||||
}
|
||||
goto end;
|
||||
}
|
||||
if (REG_FIELD(info, regnum) == A_SU_RD_STA) {
|
||||
if (REG_FIELD(info, regnum) == A_SU_RD_STA)
|
||||
su_new_state(xpd, REG_FIELD(info, data_low));
|
||||
}
|
||||
|
||||
/* Update /proc info only if reply relate to the last slic read request */
|
||||
if (REG_FIELD(&xpd->requested_reply, regnum) ==
|
||||
@@ -1672,11 +1668,10 @@ static int proc_bri_info_read(char *page, char **start, off_t off, int count,
|
||||
priv->state_register.bits.v_g2_g3);
|
||||
} else
|
||||
len += sprintf(page + len, "Unknown\n");
|
||||
if (IS_NT(xpd)) {
|
||||
if (IS_NT(xpd))
|
||||
len += sprintf(page + len, "T1 Timer: %d\n", priv->t1);
|
||||
} else {
|
||||
else
|
||||
len += sprintf(page + len, "T3 Timer: %d\n", priv->t3);
|
||||
}
|
||||
len += sprintf(page + len, "Tick Counter: %d\n", priv->tick_counter);
|
||||
len +=
|
||||
sprintf(page + len, "Last Poll Reply: %d ticks ago\n",
|
||||
|
||||
@@ -241,11 +241,10 @@ static int do_led(xpd_t *xpd, lineno_t chan, __u8 which, bool on)
|
||||
if (chan == PORT_BROADCAST) {
|
||||
priv->ledstate[which] = (on) ? ~0 : 0;
|
||||
} else {
|
||||
if (on) {
|
||||
if (on)
|
||||
BIT_SET(priv->ledstate[which], chan);
|
||||
} else {
|
||||
else
|
||||
BIT_CLR(priv->ledstate[which], chan);
|
||||
}
|
||||
}
|
||||
value = 0;
|
||||
value |= ((BIT(5) | BIT(6) | BIT(7)) & ~led_register_mask[which]);
|
||||
@@ -289,11 +288,10 @@ static void handle_fxo_leds(xpd_t *xpd)
|
||||
(IS_SET
|
||||
(priv->ledstate[color],
|
||||
i)) ? "ON" : "OFF");
|
||||
if (!IS_SET(priv->ledstate[color], i)) {
|
||||
if (!IS_SET(priv->ledstate[color], i))
|
||||
do_led(xpd, i, color, 1);
|
||||
} else {
|
||||
else
|
||||
do_led(xpd, i, color, 0);
|
||||
}
|
||||
}
|
||||
} else if (IS_SET(priv->ledcontrol[color], i)
|
||||
&& !IS_SET(priv->ledstate[color], i)) {
|
||||
|
||||
@@ -266,11 +266,10 @@ static int do_led(xpd_t *xpd, lineno_t chan, __u8 which, bool on)
|
||||
if (chan == PORT_BROADCAST) {
|
||||
priv->ledstate[which] = (on) ? ~0 : 0;
|
||||
} else {
|
||||
if (on) {
|
||||
if (on)
|
||||
BIT_SET(priv->ledstate[which], chan);
|
||||
} else {
|
||||
else
|
||||
BIT_CLR(priv->ledstate[which], chan);
|
||||
}
|
||||
}
|
||||
LINE_DBG(LEDS, xpd, chan, "LED: which=%d -- %s\n", which,
|
||||
(on) ? "on" : "off");
|
||||
@@ -315,11 +314,10 @@ static void handle_fxs_leds(xpd_t *xpd)
|
||||
(IS_SET
|
||||
(priv->ledstate[color],
|
||||
i)) ? "ON" : "OFF");
|
||||
if (!IS_SET(priv->ledstate[color], i)) {
|
||||
if (!IS_SET(priv->ledstate[color], i))
|
||||
do_led(xpd, i, color, 1);
|
||||
} else {
|
||||
else
|
||||
do_led(xpd, i, color, 0);
|
||||
}
|
||||
}
|
||||
} else
|
||||
if (IS_SET
|
||||
@@ -937,12 +935,10 @@ static int set_vmwi(xpd_t *xpd, int pos, unsigned long arg)
|
||||
"%s: VMWI(hvdc) is not implemented yet. Ignored.\n",
|
||||
__func__);
|
||||
}
|
||||
if (VMWI_TYPE(priv, pos, HVAC)) {
|
||||
if (VMWI_TYPE(priv, pos, HVAC))
|
||||
; /* VMWI_NEON */
|
||||
}
|
||||
if (priv->vmwisetting[pos].vmwi_type == 0) {
|
||||
if (priv->vmwisetting[pos].vmwi_type == 0)
|
||||
; /* Disable VMWI */
|
||||
}
|
||||
priv->vmwisetting[pos] = vmwisetting;
|
||||
set_vm_led_mode(xpd->xbus, xpd, pos, PHONEDEV(xpd).msg_waiting[pos]);
|
||||
return 0;
|
||||
@@ -1308,9 +1304,8 @@ static void detect_vmwi(xpd_t *xpd)
|
||||
int j;
|
||||
|
||||
LINE_NOTICE(xpd, i, "MSG WAITING Unexpected:");
|
||||
for (j = 0; j < DAHDI_CHUNKSIZE; j++) {
|
||||
for (j = 0; j < DAHDI_CHUNKSIZE; j++)
|
||||
printk(" %02X", writechunk[j]);
|
||||
}
|
||||
printk("\n");
|
||||
}
|
||||
}
|
||||
@@ -1504,9 +1499,8 @@ static void process_dtmf(xpd_t *xpd, uint portnum, __u8 val)
|
||||
digit = dtmf_digits[val];
|
||||
want_mute = IS_SET(priv->want_dtmf_mute, portnum);
|
||||
want_event = IS_SET(priv->want_dtmf_events, portnum);
|
||||
if (!IS_SET(priv->prev_key_down, portnum) && !key_down) {
|
||||
if (!IS_SET(priv->prev_key_down, portnum) && !key_down)
|
||||
LINE_NOTICE(xpd, portnum, "DTMF: duplicate UP (%c)\n", digit);
|
||||
}
|
||||
if (key_down)
|
||||
BIT_SET(priv->prev_key_down, portnum);
|
||||
else
|
||||
@@ -1562,9 +1556,8 @@ static int FXS_card_register_reply(xbus_t *xbus, xpd_t *xpd, reg_cmd_t *info)
|
||||
/*
|
||||
* Process digital inputs polling results
|
||||
*/
|
||||
else if (!indirect && regnum == REG_DIGITAL_IOCTRL) {
|
||||
else if (!indirect && regnum == REG_DIGITAL_IOCTRL)
|
||||
process_digital_inputs(xpd, info);
|
||||
}
|
||||
#endif
|
||||
else if (!indirect && regnum == REG_LOOPCLOSURE) { /* OFFHOOK ? */
|
||||
__u8 val = REG_FIELD(info, data_low);
|
||||
|
||||
@@ -843,9 +843,8 @@ static void set_rbslines(xpd_t *xpd, int channo)
|
||||
int bytenum = i / 8;
|
||||
int bitnum = i % 8;
|
||||
|
||||
if (!IS_SET(new_rbslines, i)) {
|
||||
if (!IS_SET(new_rbslines, i))
|
||||
BIT_SET(clear_lines, (7 - bitnum));
|
||||
}
|
||||
if (IS_SET(modified_lines, i))
|
||||
reg_changed = 1;
|
||||
if (bitnum == 7) {
|
||||
@@ -1156,9 +1155,8 @@ static int pri_chanconfig(struct file *file, struct dahdi_chan *chan,
|
||||
chan->channo, chan->name);
|
||||
SET_DCHAN(priv, chan->channo);
|
||||
/* In T1, we don't know before-hand */
|
||||
if (priv->pri_protocol != PRI_PROTO_E1 && priv->is_cas != 0) {
|
||||
if (priv->pri_protocol != PRI_PROTO_E1 && priv->is_cas != 0)
|
||||
set_mode_cas(xpd, 0);
|
||||
}
|
||||
} else {
|
||||
if (chan->channo == 1) {
|
||||
XPD_DBG(GENERAL, xpd,
|
||||
@@ -1376,9 +1374,8 @@ static void dchan_state(xpd_t *xpd, bool up)
|
||||
BUG_ON(!xpd);
|
||||
priv = xpd->priv;
|
||||
BUG_ON(!priv);
|
||||
if (priv->is_cas) {
|
||||
if (priv->is_cas)
|
||||
return;
|
||||
}
|
||||
if (priv->dchan_alive == up)
|
||||
return;
|
||||
if (!priv->layer1_up) /* No layer1, kill dchan */
|
||||
@@ -1724,9 +1721,8 @@ static int pri_rbsbits(struct dahdi_chan *chan, int bits)
|
||||
sig2str(chan->sig), bits);
|
||||
return 0;
|
||||
}
|
||||
if (!priv->layer1_up) {
|
||||
if (!priv->layer1_up)
|
||||
XPD_DBG(SIGNAL, xpd, "RBS: TX: No layer1 yet. Keep going.\n");
|
||||
}
|
||||
if (priv->pri_protocol == PRI_PROTO_E1) {
|
||||
if (encode_rbsbits_e1(xpd, pos, bits) < 0)
|
||||
return -EINVAL;
|
||||
@@ -1776,14 +1772,12 @@ static void PRI_card_pcm_fromspan(xpd_t *xpd, xpacket_t *pack)
|
||||
|
||||
if (priv->pri_protocol == PRI_PROTO_E1) {
|
||||
/* In E1 - Only 0'th channel is unused */
|
||||
if (i == 0) {
|
||||
if (i == 0)
|
||||
physical_chan++;
|
||||
}
|
||||
} else if (priv->pri_protocol == PRI_PROTO_T1) {
|
||||
/* In T1 - Every 4'th channel is unused */
|
||||
if ((i % 3) == 0) {
|
||||
if ((i % 3) == 0)
|
||||
physical_chan++;
|
||||
}
|
||||
}
|
||||
if (IS_SET(wanted_lines, i)) {
|
||||
physical_mask |= BIT(physical_chan);
|
||||
@@ -2214,9 +2208,8 @@ static int PRI_card_register_reply(xbus_t *xbus, xpd_t *xpd, reg_cmd_t *info)
|
||||
else if (regnum == REG_FRS1 && !REG_FIELD(info, do_subreg))
|
||||
priv->reg_frs1 = data_low;
|
||||
if (priv->is_cas && !REG_FIELD(info, do_subreg)) {
|
||||
if (regnum >= REG_RS1_E && regnum <= REG_RS16_E) {
|
||||
if (regnum >= REG_RS1_E && regnum <= REG_RS16_E)
|
||||
process_cas_dchan(xpd, regnum, data_low);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Update /proc info only if reply relate to the
|
||||
@@ -2496,14 +2489,12 @@ static DEVICE_ATTR_READER(pri_cas_show, dev, buf)
|
||||
len +=
|
||||
sprintf(buf + len, "CAS: replies=%d\n", priv->cas_replies);
|
||||
len += sprintf(buf + len, " CAS-TS: ");
|
||||
for (i = 0; i < NUM_CAS_RS_E; i++) {
|
||||
for (i = 0; i < NUM_CAS_RS_E; i++)
|
||||
len += sprintf(buf + len, " %02X", priv->cas_ts_e[i]);
|
||||
}
|
||||
len += sprintf(buf + len, "\n");
|
||||
len += sprintf(buf + len, " CAS-RS: ");
|
||||
for (i = 0; i < NUM_CAS_RS_E; i++) {
|
||||
for (i = 0; i < NUM_CAS_RS_E; i++)
|
||||
len += sprintf(buf + len, " %02X", priv->cas_rs_e[i]);
|
||||
}
|
||||
len += sprintf(buf + len, "\n");
|
||||
}
|
||||
spin_unlock_irqrestore(&xpd->lock, flags);
|
||||
|
||||
@@ -88,9 +88,8 @@ static void print_buffer(const char *msg, const char *buf, int len)
|
||||
{
|
||||
int i;
|
||||
printk(KERN_ERR "%s", msg);
|
||||
for (i = 0; i < len; i++) {
|
||||
for (i = 0; i < len; i++)
|
||||
printk("%02X ", (unsigned char)buf[i]);
|
||||
}
|
||||
printk("\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -263,9 +263,8 @@ xpacket_t *xframe_next_packet(xframe_t *frm, int len)
|
||||
DBG(GENERAL, "len=%d, newlen=%d, frm->frame_len=%d\n",
|
||||
len, newlen, XFRAME_LEN(frm));
|
||||
#endif
|
||||
if (newlen > XFRAME_DATASIZE) {
|
||||
if (newlen > XFRAME_DATASIZE)
|
||||
return NULL;
|
||||
}
|
||||
atomic_add(len, &frm->frame_len);
|
||||
return (xpacket_t *)(frm->packets + newlen - len);
|
||||
}
|
||||
@@ -476,9 +475,8 @@ static void xbus_command_queue_clean(xbus_t *xbus)
|
||||
|
||||
XBUS_DBG(DEVICES, xbus, "count=%d\n", xbus->command_queue.count);
|
||||
xframe_queue_disable(&xbus->command_queue, 1);
|
||||
while ((frm = xframe_dequeue(&xbus->command_queue)) != NULL) {
|
||||
while ((frm = xframe_dequeue(&xbus->command_queue)) != NULL)
|
||||
FREE_SEND_XFRAME(xbus, frm);
|
||||
}
|
||||
}
|
||||
|
||||
static int xbus_command_queue_waitempty(xbus_t *xbus)
|
||||
@@ -490,9 +488,8 @@ static int xbus_command_queue_waitempty(xbus_t *xbus)
|
||||
wait_event_interruptible(xbus->command_queue_empty,
|
||||
xframe_queue_count(&xbus->command_queue) ==
|
||||
0);
|
||||
if (ret) {
|
||||
if (ret)
|
||||
XBUS_ERR(xbus, "waiting for command_queue interrupted!!!\n");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -561,9 +558,8 @@ static void receive_tasklet_func(unsigned long data)
|
||||
|
||||
BUG_ON(!xbus);
|
||||
xbus->cpu_rcv_tasklet[cpu]++;
|
||||
while ((xframe = xframe_dequeue(&xbus->receive_queue)) != NULL) {
|
||||
while ((xframe = xframe_dequeue(&xbus->receive_queue)) != NULL)
|
||||
xframe_receive(xbus, xframe);
|
||||
}
|
||||
}
|
||||
|
||||
void xbus_receive_xframe(xbus_t *xbus, xframe_t *xframe)
|
||||
@@ -809,9 +805,8 @@ static int xpd_initialize(xpd_t *xpd)
|
||||
/* Turn on all channels */
|
||||
CALL_PHONE_METHOD(card_state, xpd, 1);
|
||||
}
|
||||
if (!xpd_setstate(xpd, XPD_STATE_READY)) {
|
||||
if (!xpd_setstate(xpd, XPD_STATE_READY))
|
||||
goto out;
|
||||
}
|
||||
XPD_INFO(xpd, "Initialized: %s\n", xpd->type_name);
|
||||
ret = 0;
|
||||
out:
|
||||
@@ -1597,9 +1592,8 @@ void xbus_reset_counters(xbus_t *xbus)
|
||||
int i;
|
||||
|
||||
XBUS_DBG(GENERAL, xbus, "Reseting counters\n");
|
||||
for (i = 0; i < XBUS_COUNTER_MAX; i++) {
|
||||
for (i = 0; i < XBUS_COUNTER_MAX; i++)
|
||||
xbus->counters[i] = 0;
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL(xbus_reset_counters);
|
||||
|
||||
|
||||
@@ -709,9 +709,8 @@ static DEVICE_ATTR_READER(offhook_show, dev, buf)
|
||||
for_each_line(xpd, i) {
|
||||
len += sprintf(buf + len, "%d ", IS_OFFHOOK(xpd, i));
|
||||
}
|
||||
if (len) {
|
||||
if (len)
|
||||
len--; /* backout last space */
|
||||
}
|
||||
len += sprintf(buf + len, "\n");
|
||||
return len;
|
||||
}
|
||||
|
||||
@@ -368,21 +368,17 @@ static int xpd_read_proc(char *page, char **start, off_t off, int count,
|
||||
memcpy(rchunk, rp, DAHDI_CHUNKSIZE);
|
||||
memcpy(wchunk, wp, DAHDI_CHUNKSIZE);
|
||||
len += sprintf(page + len, "\n port %2d> | ", i);
|
||||
for (j = 0; j < DAHDI_CHUNKSIZE; j++) {
|
||||
for (j = 0; j < DAHDI_CHUNKSIZE; j++)
|
||||
len += sprintf(page + len, "%02X ", rchunk[j]);
|
||||
}
|
||||
len += sprintf(page + len, " | ");
|
||||
for (j = 0; j < DAHDI_CHUNKSIZE; j++) {
|
||||
for (j = 0; j < DAHDI_CHUNKSIZE; j++)
|
||||
len += sprintf(page + len, "%02X ", wchunk[j]);
|
||||
}
|
||||
len +=
|
||||
sprintf(page + len, " | %c",
|
||||
(IS_SET(PHONEDEV(xpd).wanted_pcm_mask, i)) ?
|
||||
'+' : ' ');
|
||||
len +=
|
||||
sprintf(page + len, " %c",
|
||||
(IS_SET(PHONEDEV(xpd).mute_dtmf, i)) ? '-' :
|
||||
' ');
|
||||
len += sprintf(page + len, " | %c",
|
||||
(IS_SET(PHONEDEV(xpd).wanted_pcm_mask, i))
|
||||
? '+' : ' ');
|
||||
len += sprintf(page + len, " %c",
|
||||
(IS_SET(PHONEDEV(xpd).mute_dtmf, i))
|
||||
? '-' : ' ');
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -487,9 +483,8 @@ static void phonedev_cleanup(xpd_t *xpd)
|
||||
unsigned int x;
|
||||
|
||||
for (x = 0; x < phonedev->channels; x++) {
|
||||
if (phonedev->chans[x]) {
|
||||
if (phonedev->chans[x])
|
||||
KZFREE(phonedev->chans[x]);
|
||||
}
|
||||
if (phonedev->ec[x])
|
||||
KZFREE(phonedev->ec[x]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user