/* find the db type by using sensor base unit type */
enum ipmi_unit_type_e ipmi_type = ipmi_sensor_get_base_unit(sensor);
- for (int i = 0; i < STATIC_ARRAY_SIZE(ipmi_db_type_map); i++)
+ for (size_t i = 0; i < STATIC_ARRAY_SIZE(ipmi_db_type_map); i++)
if (ipmi_db_type_map[i].type == ipmi_type)
return ipmi_db_type_map[i].type_name;
return 0;
}
- list_item = (c_ipmi_sensor_list_t *)calloc(1, sizeof(c_ipmi_sensor_list_t));
+ list_item = calloc(1, sizeof(*list_item));
if (list_item == NULL) {
pthread_mutex_unlock(&st->sensor_list_lock);
return -1;