Commit a5a0d52c7305cb3629ef0cc9e2e0e106869e1907

Authored by Andrew Morton
Committed by Linus Torvalds
1 parent 1bb34a4127

[PATCH] ntp whitespace cleanup

Fix bizarre 4-space coding style in the NTP code.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 1 changed file with 126 additions and 126 deletions Side-by-side Diff

... ... @@ -632,77 +632,74 @@
632 632 */
633 633 static void second_overflow(void)
634 634 {
635   - long ltemp;
  635 + long ltemp;
636 636  
637   - /* Bump the maxerror field */
638   - time_maxerror += time_tolerance >> SHIFT_USEC;
639   - if ( time_maxerror > NTP_PHASE_LIMIT ) {
640   - time_maxerror = NTP_PHASE_LIMIT;
641   - time_status |= STA_UNSYNC;
642   - }
643   -
644   - /*
645   - * Leap second processing. If in leap-insert state at
646   - * the end of the day, the system clock is set back one
647   - * second; if in leap-delete state, the system clock is
648   - * set ahead one second. The microtime() routine or
649   - * external clock driver will insure that reported time
650   - * is always monotonic. The ugly divides should be
651   - * replaced.
652   - */
653   - switch (time_state) {
654   -
655   - case TIME_OK:
656   - if (time_status & STA_INS)
657   - time_state = TIME_INS;
658   - else if (time_status & STA_DEL)
659   - time_state = TIME_DEL;
660   - break;
661   -
662   - case TIME_INS:
663   - if (xtime.tv_sec % 86400 == 0) {
664   - xtime.tv_sec--;
665   - wall_to_monotonic.tv_sec++;
666   - /* The timer interpolator will make time change gradually instead
667   - * of an immediate jump by one second.
668   - */
669   - time_interpolator_update(-NSEC_PER_SEC);
670   - time_state = TIME_OOP;
671   - clock_was_set();
672   - printk(KERN_NOTICE "Clock: inserting leap second 23:59:60 UTC\n");
  637 + /* Bump the maxerror field */
  638 + time_maxerror += time_tolerance >> SHIFT_USEC;
  639 + if (time_maxerror > NTP_PHASE_LIMIT) {
  640 + time_maxerror = NTP_PHASE_LIMIT;
  641 + time_status |= STA_UNSYNC;
673 642 }
674   - break;
675 643  
676   - case TIME_DEL:
677   - if ((xtime.tv_sec + 1) % 86400 == 0) {
678   - xtime.tv_sec++;
679   - wall_to_monotonic.tv_sec--;
680   - /* Use of time interpolator for a gradual change of time */
681   - time_interpolator_update(NSEC_PER_SEC);
682   - time_state = TIME_WAIT;
683   - clock_was_set();
684   - printk(KERN_NOTICE "Clock: deleting leap second 23:59:59 UTC\n");
  644 + /*
  645 + * Leap second processing. If in leap-insert state at the end of the
  646 + * day, the system clock is set back one second; if in leap-delete
  647 + * state, the system clock is set ahead one second. The microtime()
  648 + * routine or external clock driver will insure that reported time is
  649 + * always monotonic. The ugly divides should be replaced.
  650 + */
  651 + switch (time_state) {
  652 + case TIME_OK:
  653 + if (time_status & STA_INS)
  654 + time_state = TIME_INS;
  655 + else if (time_status & STA_DEL)
  656 + time_state = TIME_DEL;
  657 + break;
  658 + case TIME_INS:
  659 + if (xtime.tv_sec % 86400 == 0) {
  660 + xtime.tv_sec--;
  661 + wall_to_monotonic.tv_sec++;
  662 + /*
  663 + * The timer interpolator will make time change
  664 + * gradually instead of an immediate jump by one second
  665 + */
  666 + time_interpolator_update(-NSEC_PER_SEC);
  667 + time_state = TIME_OOP;
  668 + clock_was_set();
  669 + printk(KERN_NOTICE "Clock: inserting leap second "
  670 + "23:59:60 UTC\n");
  671 + }
  672 + break;
  673 + case TIME_DEL:
  674 + if ((xtime.tv_sec + 1) % 86400 == 0) {
  675 + xtime.tv_sec++;
  676 + wall_to_monotonic.tv_sec--;
  677 + /*
  678 + * Use of time interpolator for a gradual change of
  679 + * time
  680 + */
  681 + time_interpolator_update(NSEC_PER_SEC);
  682 + time_state = TIME_WAIT;
  683 + clock_was_set();
  684 + printk(KERN_NOTICE "Clock: deleting leap second "
  685 + "23:59:59 UTC\n");
  686 + }
  687 + break;
  688 + case TIME_OOP:
  689 + time_state = TIME_WAIT;
  690 + break;
  691 + case TIME_WAIT:
  692 + if (!(time_status & (STA_INS | STA_DEL)))
  693 + time_state = TIME_OK;
685 694 }
686   - break;
687 695  
688   - case TIME_OOP:
689   - time_state = TIME_WAIT;
690   - break;
691   -
692   - case TIME_WAIT:
693   - if (!(time_status & (STA_INS | STA_DEL)))
694   - time_state = TIME_OK;
695   - }
696   -
697   - /*
698   - * Compute the phase adjustment for the next second. In
699   - * PLL mode, the offset is reduced by a fixed factor
700   - * times the time constant. In FLL mode the offset is
701   - * used directly. In either mode, the maximum phase
702   - * adjustment for each second is clamped so as to spread
703   - * the adjustment over not more than the number of
704   - * seconds between updates.
705   - */
  696 + /*
  697 + * Compute the phase adjustment for the next second. In PLL mode, the
  698 + * offset is reduced by a fixed factor times the time constant. In FLL
  699 + * mode the offset is used directly. In either mode, the maximum phase
  700 + * adjustment for each second is clamped so as to spread the adjustment
  701 + * over not more than the number of seconds between updates.
  702 + */
706 703 ltemp = time_offset;
707 704 if (!(time_status & STA_FLL))
708 705 ltemp = shift_right(ltemp, SHIFT_KG + time_constant);
709 706  
710 707  
711 708  
... ... @@ -711,40 +708,42 @@
711 708 time_offset -= ltemp;
712 709 time_adj = ltemp << (SHIFT_SCALE - SHIFT_HZ - SHIFT_UPDATE);
713 710  
714   - /*
715   - * Compute the frequency estimate and additional phase
716   - * adjustment due to frequency error for the next
717   - * second. When the PPS signal is engaged, gnaw on the
718   - * watchdog counter and update the frequency computed by
719   - * the pll and the PPS signal.
720   - */
721   - pps_valid++;
722   - if (pps_valid == PPS_VALID) { /* PPS signal lost */
723   - pps_jitter = MAXTIME;
724   - pps_stabil = MAXFREQ;
725   - time_status &= ~(STA_PPSSIGNAL | STA_PPSJITTER |
726   - STA_PPSWANDER | STA_PPSERROR);
727   - }
728   - ltemp = time_freq + pps_freq;
729   - time_adj += shift_right(ltemp,(SHIFT_USEC + SHIFT_HZ - SHIFT_SCALE));
  711 + /*
  712 + * Compute the frequency estimate and additional phase adjustment due
  713 + * to frequency error for the next second. When the PPS signal is
  714 + * engaged, gnaw on the watchdog counter and update the frequency
  715 + * computed by the pll and the PPS signal.
  716 + */
  717 + pps_valid++;
  718 + if (pps_valid == PPS_VALID) { /* PPS signal lost */
  719 + pps_jitter = MAXTIME;
  720 + pps_stabil = MAXFREQ;
  721 + time_status &= ~(STA_PPSSIGNAL | STA_PPSJITTER |
  722 + STA_PPSWANDER | STA_PPSERROR);
  723 + }
  724 + ltemp = time_freq + pps_freq;
  725 + time_adj += shift_right(ltemp,(SHIFT_USEC + SHIFT_HZ - SHIFT_SCALE));
730 726  
731 727 #if HZ == 100
732   - /* Compensate for (HZ==100) != (1 << SHIFT_HZ).
733   - * Add 25% and 3.125% to get 128.125; => only 0.125% error (p. 14)
734   - */
735   - time_adj += shift_right(time_adj, 2) + shift_right(time_adj, 5);
  728 + /*
  729 + * Compensate for (HZ==100) != (1 << SHIFT_HZ). Add 25% and 3.125% to
  730 + * get 128.125; => only 0.125% error (p. 14)
  731 + */
  732 + time_adj += shift_right(time_adj, 2) + shift_right(time_adj, 5);
736 733 #endif
737 734 #if HZ == 250
738   - /* Compensate for (HZ==250) != (1 << SHIFT_HZ).
739   - * Add 1.5625% and 0.78125% to get 255.85938; => only 0.05% error (p. 14)
740   - */
741   - time_adj += shift_right(time_adj, 6) + shift_right(time_adj, 7);
  735 + /*
  736 + * Compensate for (HZ==250) != (1 << SHIFT_HZ). Add 1.5625% and
  737 + * 0.78125% to get 255.85938; => only 0.05% error (p. 14)
  738 + */
  739 + time_adj += shift_right(time_adj, 6) + shift_right(time_adj, 7);
742 740 #endif
743 741 #if HZ == 1000
744   - /* Compensate for (HZ==1000) != (1 << SHIFT_HZ).
745   - * Add 1.5625% and 0.78125% to get 1023.4375; => only 0.05% error (p. 14)
746   - */
747   - time_adj += shift_right(time_adj, 6) + shift_right(time_adj, 7);
  742 + /*
  743 + * Compensate for (HZ==1000) != (1 << SHIFT_HZ). Add 1.5625% and
  744 + * 0.78125% to get 1023.4375; => only 0.05% error (p. 14)
  745 + */
  746 + time_adj += shift_right(time_adj, 6) + shift_right(time_adj, 7);
748 747 #endif
749 748 }
750 749  
751 750  
... ... @@ -753,21 +752,20 @@
753 752 {
754 753 long time_adjust_step, delta_nsec;
755 754  
756   - if ( (time_adjust_step = time_adjust) != 0 ) {
757   - /* We are doing an adjtime thing.
758   - *
759   - * Prepare time_adjust_step to be within bounds.
760   - * Note that a positive time_adjust means we want the clock
761   - * to run faster.
762   - *
763   - * Limit the amount of the step to be in the range
764   - * -tickadj .. +tickadj
765   - */
766   - time_adjust_step = min(time_adjust_step, (long)tickadj);
767   - time_adjust_step = max(time_adjust_step, (long)-tickadj);
  755 + if ((time_adjust_step = time_adjust) != 0 ) {
  756 + /*
  757 + * We are doing an adjtime thing. Prepare time_adjust_step to
  758 + * be within bounds. Note that a positive time_adjust means we
  759 + * want the clock to run faster.
  760 + *
  761 + * Limit the amount of the step to be in the range
  762 + * -tickadj .. +tickadj
  763 + */
  764 + time_adjust_step = min(time_adjust_step, (long)tickadj);
  765 + time_adjust_step = max(time_adjust_step, (long)-tickadj);
768 766  
769   - /* Reduce by this step the amount of time left */
770   - time_adjust -= time_adjust_step;
  767 + /* Reduce by this step the amount of time left */
  768 + time_adjust -= time_adjust_step;
771 769 }
772 770 delta_nsec = tick_nsec + time_adjust_step * 1000;
773 771 /*
... ... @@ -1106,8 +1104,8 @@
1106 1104 if (timeout < 0)
1107 1105 {
1108 1106 printk(KERN_ERR "schedule_timeout: wrong timeout "
1109   - "value %lx from %p\n", timeout,
1110   - __builtin_return_address(0));
  1107 + "value %lx from %p\n", timeout,
  1108 + __builtin_return_address(0));
1111 1109 current->state = TASK_RUNNING;
1112 1110 goto out;
1113 1111 }
1114 1112  
... ... @@ -1133,15 +1131,15 @@
1133 1131 */
1134 1132 signed long __sched schedule_timeout_interruptible(signed long timeout)
1135 1133 {
1136   - __set_current_state(TASK_INTERRUPTIBLE);
1137   - return schedule_timeout(timeout);
  1134 + __set_current_state(TASK_INTERRUPTIBLE);
  1135 + return schedule_timeout(timeout);
1138 1136 }
1139 1137 EXPORT_SYMBOL(schedule_timeout_interruptible);
1140 1138  
1141 1139 signed long __sched schedule_timeout_uninterruptible(signed long timeout)
1142 1140 {
1143   - __set_current_state(TASK_UNINTERRUPTIBLE);
1144   - return schedule_timeout(timeout);
  1141 + __set_current_state(TASK_UNINTERRUPTIBLE);
  1142 + return schedule_timeout(timeout);
1145 1143 }
1146 1144 EXPORT_SYMBOL(schedule_timeout_uninterruptible);
1147 1145  
1148 1146  
... ... @@ -1481,16 +1479,18 @@
1481 1479 if (!time_interpolator)
1482 1480 return;
1483 1481  
1484   - /* The interpolator compensates for late ticks by accumulating
1485   - * the late time in time_interpolator->offset. A tick earlier than
1486   - * expected will lead to a reset of the offset and a corresponding
1487   - * jump of the clock forward. Again this only works if the
1488   - * interpolator clock is running slightly slower than the regular clock
1489   - * and the tuning logic insures that.
1490   - */
  1482 + /*
  1483 + * The interpolator compensates for late ticks by accumulating the late
  1484 + * time in time_interpolator->offset. A tick earlier than expected will
  1485 + * lead to a reset of the offset and a corresponding jump of the clock
  1486 + * forward. Again this only works if the interpolator clock is running
  1487 + * slightly slower than the regular clock and the tuning logic insures
  1488 + * that.
  1489 + */
1491 1490  
1492 1491 counter = time_interpolator_get_counter(1);
1493   - offset = time_interpolator->offset + GET_TI_NSECS(counter, time_interpolator);
  1492 + offset = time_interpolator->offset +
  1493 + GET_TI_NSECS(counter, time_interpolator);
1494 1494  
1495 1495 if (delta_nsec < 0 || (unsigned long) delta_nsec < offset)
1496 1496 time_interpolator->offset = offset - delta_nsec;