[dahdi-commits] russell: linux/trunk r4684 - /linux/trunk/drivers/dahdi/dahdi-base.c
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Sun Aug 3 11:38:30 CDT 2008
Author: russell
Date: Sun Aug 3 11:38:30 2008
New Revision: 4684
URL: http://svn.digium.com/view/dahdi?view=rev&rev=4684
Log:
reduce indentation and tweak formatting of a for loop in proc_read
Modified:
linux/trunk/drivers/dahdi/dahdi-base.c
Modified: linux/trunk/drivers/dahdi/dahdi-base.c
URL: http://svn.digium.com/view/dahdi/linux/trunk/drivers/dahdi/dahdi-base.c?view=diff&rev=4684&r1=4683&r2=4684
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi-base.c (original)
+++ linux/trunk/drivers/dahdi/dahdi-base.c Sun Aug 3 11:38:30 2008
@@ -604,44 +604,41 @@
len += sprintf(page + len, "\tTiming slips: %d\n", spans[span]->timingslips);
len += sprintf(page + len, "\n");
-
- for (x=1;x<DAHDI_MAX_CHANNELS;x++) {
- if (chans[x]) {
- if (chans[x]->span && (chans[x]->span->spanno == span)) {
- if (chans[x]->name)
- len += sprintf(page + len, "\t%4d %s ", x, chans[x]->name);
- if (chans[x]->sig) {
- if (chans[x]->sig == DAHDI_SIG_SLAVE)
- len += sprintf(page + len, "%s ", sigstr(chans[x]->master->sig));
- else {
- len += sprintf(page + len, "%s ", sigstr(chans[x]->sig));
- if (chans[x]->nextslave && chans[x]->master->channo == x)
- len += sprintf(page + len, "Master ");
- }
+ for (x = 1; x < DAHDI_MAX_CHANNELS; x++) {
+ if (!chans[x])
+ continue;
+
+ if (chans[x]->span && (chans[x]->span->spanno == span)) {
+ if (chans[x]->name)
+ len += sprintf(page + len, "\t%4d %s ", x, chans[x]->name);
+ if (chans[x]->sig) {
+ if (chans[x]->sig == DAHDI_SIG_SLAVE)
+ len += sprintf(page + len, "%s ", sigstr(chans[x]->master->sig));
+ else {
+ len += sprintf(page + len, "%s ", sigstr(chans[x]->sig));
+ if (chans[x]->nextslave && chans[x]->master->channo == x)
+ len += sprintf(page + len, "Master ");
}
- if (test_bit(DAHDI_FLAGBIT_OPEN, &chans[x]->flags)) {
- len += sprintf(page + len, "(In use) ");
- }
+ }
+ if (test_bit(DAHDI_FLAGBIT_OPEN, &chans[x]->flags))
+ len += sprintf(page + len, "(In use) ");
#ifdef OPTIMIZE_CHANMUTE
- if (chans[x]->chanmute) {
- len += sprintf(page + len, "(no pcm) ");
- }
-#endif
- len += fill_alarm_string(page + len, count - len, chans[x]->chan_alarms);
-
- if (chans[x]->ec_factory) {
- len += sprintf(page + len, " (EC: %s) ", chans[x]->ec_factory->name);
- }
-
- len += sprintf(page + len, "\n");
- }
- if (len <= off) { /* If everything printed so far is before beginning of request */
- off -= len;
- len = 0;
- }
- if (len > off+count) /* stop if we've already generated enough */
- break;
- }
+ if (chans[x]->chanmute)
+ len += sprintf(page + len, "(no pcm) ");
+#endif
+ len += fill_alarm_string(page + len, count - len, chans[x]->chan_alarms);
+
+ if (chans[x]->ec_factory)
+ len += sprintf(page + len, " (EC: %s) ", chans[x]->ec_factory->name);
+
+ len += sprintf(page + len, "\n");
+ }
+ if (len <= off) { /* If everything printed so far is before beginning of request */
+ off -= len;
+ len = 0;
+ }
+ if (len > off + count) /* stop if we've already generated enough */
+ break;
}
if (len <= off) { /* If everything printed so far is before beginning of request */
off -= len;
@@ -649,7 +646,8 @@
}
*start = page + off;
len -= off; /* un-count any remaining offset */
- if (len > count) len = count; /* don't return bytes not asked for */
+ if (len > count)
+ len = count; /* don't return bytes not asked for */
return len;
}
#endif
More information about the dahdi-commits
mailing list