staging: comedi: 8253.h: remove the unused i8253_cascade_ns_to_timer_*()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 29 Apr 2014 19:59:34 +0000 (12:59 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 4 May 2014 00:06:31 +0000 (20:06 -0400)
None of the comedi drivers use the i8253_cascade_ns_to_timer_2div_old()
or i8253_cascade_ns_to_timer_power() helpers to calculate the cascaded
divisors. Remove them to avoid any confusion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/8253.h

index 88cd6f251dcce7b8894457eea7d58098dc742176..fb2c9d9057238bdd81c3314e1d0b9053734c8e55 100644 (file)
 #define I8254_OSC_BASE_2MHZ            500
 #define I8254_OSC_BASE_1MHZ            1000
 
-static inline void i8253_cascade_ns_to_timer_2div_old(int i8253_osc_base,
-                                                     unsigned int *d1,
-                                                     unsigned int *d2,
-                                                     unsigned int *nanosec,
-                                                     int round_mode)
-{
-       int divider;
-       int div1, div2;
-       int div1_glb, div2_glb, ns_glb;
-       int div1_lub, div2_lub, ns_lub;
-       int ns;
-
-       divider = (*nanosec + i8253_osc_base / 2) / i8253_osc_base;
-
-       /* find 2 integers 1<={x,y}<=65536 such that x*y is
-          close to divider */
-
-       div1_lub = div2_lub = 0;
-       div1_glb = div2_glb = 0;
-
-       ns_glb = 0;
-       ns_lub = 0xffffffff;
-
-       div2 = 0x10000;
-       for (div1 = divider / 65536 + 1; div1 < div2; div1++) {
-               div2 = divider / div1;
-
-               ns = i8253_osc_base * div1 * div2;
-               if (ns <= *nanosec && ns > ns_glb) {
-                       ns_glb = ns;
-                       div1_glb = div1;
-                       div2_glb = div2;
-               }
-
-               div2++;
-               if (div2 <= 65536) {
-                       ns = i8253_osc_base * div1 * div2;
-                       if (ns > *nanosec && ns < ns_lub) {
-                               ns_lub = ns;
-                               div1_lub = div1;
-                               div2_lub = div2;
-                       }
-               }
-       }
-
-       *nanosec = div1_lub * div2_lub * i8253_osc_base;
-       *d1 = div1_lub & 0xffff;
-       *d2 = div2_lub & 0xffff;
-       return;
-}
-
-static inline void i8253_cascade_ns_to_timer_power(int i8253_osc_base,
-                                                  unsigned int *d1,
-                                                  unsigned int *d2,
-                                                  unsigned int *nanosec,
-                                                  int round_mode)
-{
-       int div1, div2;
-       int base;
-
-       for (div1 = 2; div1 <= (1 << 16); div1 <<= 1) {
-               base = i8253_osc_base * div1;
-               round_mode &= TRIG_ROUND_MASK;
-               switch (round_mode) {
-               case TRIG_ROUND_NEAREST:
-               default:
-                       div2 = (*nanosec + base / 2) / base;
-                       break;
-               case TRIG_ROUND_DOWN:
-                       div2 = (*nanosec) / base;
-                       break;
-               case TRIG_ROUND_UP:
-                       div2 = (*nanosec + base - 1) / base;
-                       break;
-               }
-               if (div2 < 2)
-                       div2 = 2;
-               if (div2 <= 65536) {
-                       *nanosec = div2 * base;
-                       *d1 = div1 & 0xffff;
-                       *d2 = div2 & 0xffff;
-                       return;
-               }
-       }
-
-       /* shouldn't get here */
-       div1 = 0x10000;
-       div2 = 0x10000;
-       *nanosec = div1 * div2 * i8253_osc_base;
-       *d1 = div1 & 0xffff;
-       *d2 = div2 & 0xffff;
-}
-
 static inline void i8253_cascade_ns_to_timer(int i8253_osc_base,
                                             unsigned int *d1,
                                             unsigned int *d2,