@@ -358,7 +358,7 @@ bool zes_device_bus_is_healthy(char* bdf_address, uint32_t* error)
358358double zes_device_temp_max (char * bdf_address , char * sensor , uint32_t * error )
359359{
360360 if (getenv ("UNITTEST" ) != NULL ) {
361- return -999.0 ;
361+ return TEMP_ERROR_RET_VAL ;
362362 }
363363
364364 uint32_t requestedType = 0 ;
@@ -371,7 +371,7 @@ double zes_device_temp_max(char* bdf_address, char* sensor, uint32_t* error)
371371 } else {
372372 * error = ZE_RESULT_ERROR_INVALID_ARGUMENT ;
373373
374- return -999.0 ;
374+ return TEMP_ERROR_RET_VAL ;
375375 }
376376
377377 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)
381381 if (res != ZE_RESULT_SUCCESS ) {
382382 * error = res ;
383383
384- return -999.0 ;
384+ return TEMP_ERROR_RET_VAL ;
385385 }
386386 }
387387
388388 zes_device_handle_t handle = retrieve_handle_for_bdf (bdf_address );
389389 if (handle == 0 ) {
390390 * error = ZE_RESULT_ERROR_UNKNOWN ;
391391
392- return -999.0 ;
392+ return TEMP_ERROR_RET_VAL ;
393393 }
394394
395395 uint32_t count = 0 ;
396396 ze_result_t res = zesDeviceEnumTemperatureSensors (handle , & count , NULL );
397397 if (res != ZE_RESULT_SUCCESS || count == 0 ) {
398398 * error = res ;
399399
400- return -999.0 ;
400+ return TEMP_ERROR_RET_VAL ;
401401 }
402402
403403 zes_temp_handle_t tempHandles [count ];
404404 res = zesDeviceEnumTemperatureSensors (handle , & count , tempHandles );
405405 if (res != ZE_RESULT_SUCCESS ) {
406406 * error = res ;
407407
408- return -999.0 ;
408+ return TEMP_ERROR_RET_VAL ;
409409 }
410410
411411 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)
415415 if (res != ZE_RESULT_SUCCESS ) {
416416 * error = res ;
417417
418- return -999.0 ;
418+ return TEMP_ERROR_RET_VAL ;
419419 }
420420
421421 if (props .type != requestedType ) {
@@ -427,7 +427,7 @@ double zes_device_temp_max(char* bdf_address, char* sensor, uint32_t* error)
427427 if (res != ZE_RESULT_SUCCESS ) {
428428 * error = res ;
429429
430- return -999.0 ;
430+ return TEMP_ERROR_RET_VAL ;
431431 }
432432
433433 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)
437437
438438 * error = ZE_RESULT_ERROR_NOT_AVAILABLE ;
439439
440- return -999.0 ;
440+ return TEMP_ERROR_RET_VAL ;
441441}
0 commit comments