Changeset 2284

Show
Ignore:
Timestamp:
02/12/04 19:50:24 (9 years ago)
Author:
khali
Message:

Get rid of useless headers.

Remove useless second argument of IN_FROM_REG.
Misc cleanups.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/kernel/chips/lm80.c

    r2069 r2284  
    2222#include <linux/module.h> 
    2323#include <linux/slab.h> 
    24 #include <linux/proc_fs.h> 
    25 #include <linux/ioport.h> 
    26 #include <linux/sysctl.h> 
    27 #include <linux/types.h> 
    2824#include <linux/i2c.h> 
    2925#include <linux/i2c-proc.h> 
    3026#include <linux/init.h> 
    31 #include <asm/errno.h> 
    32 #include <asm/io.h> 
    3327#include "version.h" 
    3428 
     
    7670   Fixing this is just not worth it. */ 
    7771 
    78 #define IN_TO_REG(val,nr) (SENSORS_LIMIT((val),0,255)) 
    79 #define IN_FROM_REG(val,nr) (val) 
     72#define IN_TO_REG(val) (SENSORS_LIMIT((val),0,255)) 
     73#define IN_FROM_REG(val) (val) 
    8074 
    8175static inline unsigned char FAN_TO_REG(unsigned rpm, unsigned div) 
     
    9589        long res; 
    9690 
    97         temp = temp >> 4; 
    98         if (temp < 0x0800) { 
    99                 res = (625 * (long) temp); 
    100         } else { 
     91        temp >>= 4; 
     92        if (temp < 0x0800) 
     93                res = 625 * (long) temp; 
     94        else 
    10195                res = ((long) temp - 0x01000) * 625; 
    102         } 
     96 
    10397        return res / 100; 
    10498} 
     
    115109#define DIV_TO_REG(val) ((val)==8?3:(val)==4?2:(val)==1?0:1) 
    116110 
    117 /* For each registered LM80, we need to keep some data in memory. That 
    118    data is pointed to by lm80_list[NR]->data. The structure itself is 
    119    dynamically allocated, at the same time when a new lm80 client is 
    120    allocated. */ 
    121111struct lm80_data { 
    122112        int sysctl_id; 
     
    147137static int lm80_detach_client(struct i2c_client *client); 
    148138 
    149 static int lm80_read_value(struct i2c_client *client, u8 register); 
    150 static int lm80_write_value(struct i2c_client *client, u8 register, 
    151                             u8 value); 
     139static int lm80_read_value(struct i2c_client *client, u8 reg); 
     140static int lm80_write_value(struct i2c_client *client, u8 reg, u8 value); 
    152141static void lm80_update_client(struct i2c_client *client); 
    153142static void lm80_init_client(struct i2c_client *client); 
     
    375364} 
    376365 
    377 /* Called when we have found a new LM80. It should set limits, etc. */ 
     366/* Called when we have found a new LM80. */ 
    378367static void lm80_init_client(struct i2c_client *client) 
    379368{ 
     
    465454        else if (operation == SENSORS_PROC_REAL_READ) { 
    466455                lm80_update_client(client); 
    467                 results[0] = IN_FROM_REG(data->in_min[nr], nr); 
    468                 results[1] = IN_FROM_REG(data->in_max[nr], nr); 
    469                 results[2] = IN_FROM_REG(data->in[nr], nr); 
     456                results[0] = IN_FROM_REG(data->in_min[nr]); 
     457                results[1] = IN_FROM_REG(data->in_max[nr]); 
     458                results[2] = IN_FROM_REG(data->in[nr]); 
    470459                *nrels_mag = 3; 
    471460        } else if (operation == SENSORS_PROC_REAL_WRITE) { 
    472461                if (*nrels_mag >= 1) { 
    473                         data->in_min[nr] = IN_TO_REG(results[0], nr); 
     462                        data->in_min[nr] = IN_TO_REG(results[0]); 
    474463                        lm80_write_value(client, LM80_REG_IN_MIN(nr), 
    475464                                         data->in_min[nr]); 
    476465                } 
    477466                if (*nrels_mag >= 2) { 
    478                         data->in_max[nr] = IN_TO_REG(results[1], nr); 
     467                        data->in_max[nr] = IN_TO_REG(results[1]); 
    479468                        lm80_write_value(client, LM80_REG_IN_MAX(nr), 
    480469                                         data->in_max[nr]);