From 8a48b711144785cb5045e6a6a44a1cd368bfdb00 Mon Sep 17 00:00:00 2001 From: Alexander Viro Date: Thu, 3 Jun 2004 06:38:25 -0700 Subject: [PATCH] [PATCH] drivers/atm/horizon.c delousing Same as with ambassador.c - same authors, same braindamage. --- drivers/atm/horizon.c | 252 ++++++++++++++++++++---------------------- 1 file changed, 119 insertions(+), 133 deletions(-) diff --git a/drivers/atm/horizon.c b/drivers/atm/horizon.c index 90e407a9a5a84..a794610da3c7f 100644 --- a/drivers/atm/horizon.c +++ b/drivers/atm/horizon.c @@ -597,126 +597,112 @@ static inline u16 rx_q_entry_to_rx_channel (u32 x) { // p ranges from 1 to a power of 2 #define CR_MAXPEXP 4 - + static int make_rate (const hrz_dev * dev, u32 c, rounding r, - u16 * bits, unsigned int * actual) { - - // note: rounding the rate down means rounding 'p' up - - const unsigned long br = test_bit(ultra, &dev->flags) ? BR_ULT : BR_HRZ; - - u32 div = CR_MIND; - u32 pre; + u16 * bits, unsigned int * actual) +{ + // note: rounding the rate down means rounding 'p' up + const unsigned long br = test_bit(ultra, &dev->flags) ? BR_ULT : BR_HRZ; - // local fn to build the timer bits - int set_cr (void) { - // paranoia - if (div > CR_MAXD || (!pre) || pre > 1<> 1; - ++br_exp; - } - // (br >>br_exp) <> 1; + ++br_exp; + } + // (br >>br_exp) < CR_MAXD || (!pre) || pre > 1<> 1; - CLOCK_IT(); + CLOCK_IT(dev, ctrl); if (rd_regl (dev, CONTROL_0_REG) & SEEPROM_DO) res |= (1 << (data_bits-1)); } ctrl &= ~(SEEPROM_SK | SEEPROM_CS); - WRITE_IT_WAIT(); + WRITE_IT_WAIT(dev, ctrl); return res; } -- 2.53.0