@@ -358,7 +358,7 @@ bool zes_device_bus_is_healthy(char* bdf_address, uint32_t* error)
358
358
double zes_device_temp_max (char * bdf_address , char * sensor , uint32_t * error )
359
359
{
360
360
if (getenv ("UNITTEST" ) != NULL ) {
361
- return -999.0 ;
361
+ return TEMP_ERROR_RET_VAL ;
362
362
}
363
363
364
364
uint32_t requestedType = 0 ;
@@ -371,7 +371,7 @@ double zes_device_temp_max(char* bdf_address, char* sensor, uint32_t* error)
371
371
} else {
372
372
* error = ZE_RESULT_ERROR_INVALID_ARGUMENT ;
373
373
374
- return -999.0 ;
374
+ return TEMP_ERROR_RET_VAL ;
375
375
}
376
376
377
377
print_log (LOG_DEBUG , "Fetch %s temperature for %s\n" , sensor , bdf_address );
@@ -381,31 +381,31 @@ double zes_device_temp_max(char* bdf_address, char* sensor, uint32_t* error)
381
381
if (res != ZE_RESULT_SUCCESS ) {
382
382
* error = res ;
383
383
384
- return -999.0 ;
384
+ return TEMP_ERROR_RET_VAL ;
385
385
}
386
386
}
387
387
388
388
zes_device_handle_t handle = retrieve_handle_for_bdf (bdf_address );
389
389
if (handle == 0 ) {
390
390
* error = ZE_RESULT_ERROR_UNKNOWN ;
391
391
392
- return -999.0 ;
392
+ return TEMP_ERROR_RET_VAL ;
393
393
}
394
394
395
395
uint32_t count = 0 ;
396
396
ze_result_t res = zesDeviceEnumTemperatureSensors (handle , & count , NULL );
397
397
if (res != ZE_RESULT_SUCCESS || count == 0 ) {
398
398
* error = res ;
399
399
400
- return -999.0 ;
400
+ return TEMP_ERROR_RET_VAL ;
401
401
}
402
402
403
403
zes_temp_handle_t tempHandles [count ];
404
404
res = zesDeviceEnumTemperatureSensors (handle , & count , tempHandles );
405
405
if (res != ZE_RESULT_SUCCESS ) {
406
406
* error = res ;
407
407
408
- return -999.0 ;
408
+ return TEMP_ERROR_RET_VAL ;
409
409
}
410
410
411
411
for (uint32_t i = 0 ; i < count ; ++ i ) {
@@ -415,7 +415,7 @@ double zes_device_temp_max(char* bdf_address, char* sensor, uint32_t* error)
415
415
if (res != ZE_RESULT_SUCCESS ) {
416
416
* error = res ;
417
417
418
- return -999.0 ;
418
+ return TEMP_ERROR_RET_VAL ;
419
419
}
420
420
421
421
if (props .type != requestedType ) {
@@ -427,7 +427,7 @@ double zes_device_temp_max(char* bdf_address, char* sensor, uint32_t* error)
427
427
if (res != ZE_RESULT_SUCCESS ) {
428
428
* error = res ;
429
429
430
- return -999.0 ;
430
+ return TEMP_ERROR_RET_VAL ;
431
431
}
432
432
433
433
print_log (LOG_DEBUG , "> Temperature: %.1f\n" , tempCelsius );
@@ -437,5 +437,5 @@ double zes_device_temp_max(char* bdf_address, char* sensor, uint32_t* error)
437
437
438
438
* error = ZE_RESULT_ERROR_NOT_AVAILABLE ;
439
439
440
- return -999.0 ;
440
+ return TEMP_ERROR_RET_VAL ;
441
441
}
0 commit comments