SaHpiRdrT *ohoi_get_rdr_by_data(RPTable *table, SaHpiResourceIdT rid, SaHpiRdrTypeT type, void *data) { SaHpiRdrT *rdr; rdr = oh_get_rdr_next(table, rid, SAHPI_FIRST_ENTRY); while (rdr) { void * data2; data2 = oh_get_rdr_data(table, rid, rdr->RecordId); if ((type == SAHPI_SENSOR_RDR) && (rdr->RdrType == type)) { ipmi_sensor_id_t *tid1 = data; ipmi_sensor_id_t *tid2 = data2; if (tid1 && tid2) { if (!ipmi_cmp_sensor_id(*tid1, *tid2)) return rdr; } } rdr = oh_get_rdr_next(table, rid, rdr->RecordId); } return NULL; }
static sdata_t * find_sdata(ipmi_sensor_t *sensor) { ipmi_sensor_id_t id = ipmi_sensor_convert_to_id(sensor); sdata_t *link; link = sdata_list; while (link) { if (ipmi_cmp_sensor_id(id, link->sensor_id) == 0) return link; link = link->next; } return NULL; }