Changeset 4835

Show
Ignore:
Timestamp:
09/23/07 14:06:51 (7 years ago)
Author:
khali
Message:

sensors_get_all_features has a single caller now, so fold
it thereinto.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/branches/lm-sensors-3.0.0/lib/access.c

    r4834 r4835  
    331331} 
    332332 
    333 static const sensors_subfeature * 
    334 sensors_get_all_features(const sensors_chip_name *name, int *nr) 
    335 { 
    336         sensors_subfeature *subfeature_list; 
    337         int i; 
    338  
    339         for (i = 0; i < sensors_proc_chips_count; i++) 
    340                 if (sensors_match_chip(&sensors_proc_chips[i].chip, name)) { 
    341                         subfeature_list = sensors_proc_chips[i].subfeature; 
    342                         if (*nr >= sensors_proc_chips[i].subfeature_count) 
    343                                 return NULL; 
    344                         return &subfeature_list[(*nr)++]; 
    345                 } 
    346         return NULL; 
    347 } 
    348  
    349333const sensors_feature * 
    350334sensors_get_features(const sensors_chip_name *name, int *nr) 
     
    371355{ 
    372356        const sensors_subfeature *subfeature; 
     357        int i; 
    373358 
    374359        /* Seek directly to the first subfeature */ 
     
    376361                *nr = feature->first_subfeature; 
    377362 
    378         subfeature = sensors_get_all_features(name, nr); 
    379         if (!subfeature) 
    380                 return NULL;    /* end of list */ 
    381         if (subfeature->number == feature->first_subfeature || 
    382             subfeature->mapping == feature->first_subfeature) 
    383                 return subfeature; 
    384         return NULL;            /* end of subfeature list */ 
     363        for (i = 0; i < sensors_proc_chips_count; i++) 
     364                if (sensors_match_chip(&sensors_proc_chips[i].chip, name)) { 
     365                        if (*nr >= sensors_proc_chips[i].subfeature_count) 
     366                                return NULL;    /* end of list */ 
     367                        subfeature = &sensors_proc_chips[i].subfeature[(*nr)++]; 
     368                        if (subfeature->number == feature->first_subfeature || 
     369                            subfeature->mapping == feature->first_subfeature) 
     370                                return subfeature; 
     371                        return NULL;    /* end of subfeature list */ 
     372                } 
     373        return NULL;            /* no matching chip */ 
    385374} 
    386375