Changeset 4729

Show
Ignore:
Timestamp:
08/29/07 16:00:47 (6 years ago)
Author:
khali
Message:

Looking up a mapping can't fail if looking up the feature itself
succeeded (or that would be a bug in the library code.)

Files:
1 modified

Legend:

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

    r4702 r4729  
    232232        if (!(main_feature = sensors_lookup_feature_nr(name, feature))) 
    233233                return -SENSORS_ERR_NO_ENTRY; 
     234 
    234235        if (main_feature->data.compute_mapping == SENSORS_NO_MAPPING) 
    235236                alt_feature = NULL; 
    236         else if (!(alt_feature = sensors_lookup_feature_nr(name, 
    237                                         main_feature->data.compute_mapping))) 
    238                 return -SENSORS_ERR_NO_ENTRY; 
     237        else 
     238                alt_feature = sensors_lookup_feature_nr(name, 
     239                                        main_feature->data.compute_mapping); 
     240 
    239241        if (!(main_feature->data.mode & SENSORS_MODE_R)) 
    240242                return -SENSORS_ERR_ACCESS_R; 
     
    277279        if (!(main_feature = sensors_lookup_feature_nr(name, feature))) 
    278280                return -SENSORS_ERR_NO_ENTRY; 
     281 
    279282        if (main_feature->data.compute_mapping == SENSORS_NO_MAPPING) 
    280283                alt_feature = NULL; 
    281         else if (!(alt_feature = sensors_lookup_feature_nr(name, 
    282                                              main_feature->data.compute_mapping))) 
    283                 return -SENSORS_ERR_NO_ENTRY; 
     284        else 
     285                alt_feature = sensors_lookup_feature_nr(name, 
     286                                        main_feature->data.compute_mapping); 
     287 
    284288        if (!(main_feature->data.mode & SENSORS_MODE_W)) 
    285289                return -SENSORS_ERR_ACCESS_W;