Changeset 3091

Show
Ignore:
Timestamp:
09/18/05 20:30:16 (8 years ago)
Author:
mmh
Message:

(mmh)
This patch moves two macros from lib/proc.c to lib/data.h. The macros
pick up the "sensors_" prefix along the way. The motivation is the
same as the previous patch.

Location:
lm-sensors/trunk/lib
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/lib/data.h

    r2654 r3091  
    183183extern int sensors_proc_chips_max; 
    184184 
     185#define sensors_add_proc_chips(el) sensors_add_array_el( \ 
     186        (el), &sensors_proc_chips, &sensors_proc_chips_count,\ 
     187        &sensors_proc_chips_max, sizeof(struct sensors_proc_chips_entry)) 
     188 
    185189extern sensors_bus *sensors_proc_bus; 
    186190extern int sensors_proc_bus_count; 
    187191extern int sensors_proc_bus_max; 
    188192 
     193#define sensors_add_proc_bus(el) sensors_add_array_el( \ 
     194        (el), &sensors_proc_bus, &sensors_proc_bus_count,\ 
     195        &sensors_proc_bus_max, sizeof(struct sensors_bus)) 
     196 
    189197extern sensors_chip_features sensors_chip_features_list[]; 
    190198 
  • lm-sensors/trunk/lib/proc.c

    r3090 r3091  
    4646char sysfsmount[NAME_MAX]; 
    4747 
    48 #define add_proc_chips(el) sensors_add_array_el(el,\ 
    49                                        &sensors_proc_chips,\ 
    50                                        &sensors_proc_chips_count,\ 
    51                                        &sensors_proc_chips_max,\ 
    52                                        sizeof(struct sensors_proc_chips_entry)) 
    53  
    54 #define add_proc_bus(el) sensors_add_array_el(el,\ 
    55                                        &sensors_proc_bus,\ 
    56                                        &sensors_proc_bus_count,\ 
    57                                        &sensors_proc_bus_max,\ 
    58                                        sizeof(struct sensors_bus)) 
    59  
    6048static int getsysname(const sensors_chip_feature *feature, char *sysname, 
    6149        int *sysmag, char *altsysname); 
     
    10694        } 
    10795 
    108         add_proc_chips(&entry); 
     96        sensors_add_proc_chips(&entry); 
    10997         
    11098        return 1; 
     
    235223    } 
    236224    entry.sysctl = ((struct i2c_chips_data *) bufptr)->sysctl_id; 
    237     add_proc_chips(&entry); 
     225    sensors_add_proc_chips(&entry); 
    238226    bufptr += sizeof(struct i2c_chips_data); 
    239227    buflen -= sizeof(struct i2c_chips_data); 
     
    292280                                if (entry.algorithm == NULL) 
    293281                                        goto FAT_ERROR_SYS; 
    294                                 add_proc_bus(&entry); 
     282                                sensors_add_proc_bus(&entry); 
    295283                        } 
    296284                } 
     
    331319    sensors_strip_of_spaces(entry.algorithm); 
    332320    sensors_strip_of_spaces(entry.adapter); 
    333     add_proc_bus(&entry); 
     321    sensors_add_proc_bus(&entry); 
    334322    lineno++; 
    335323  }