thermal: intel: hfi: Remove a pointless die_id check
PATCH 1/1 thermal: intel: hfi: Remove a pointless die_id check
die_id is an u16 quantity. On single-die systems the default value of die_id is 0. No need to check for negative values.
Plus, removing this check makes Coverity happy.
Cc Daniel Lezcano <[email protected]>
Cc Amit Kucheria <[email protected]>
Cc Zhang Rui <[email protected]>
Cc Len Brown <[email protected]>
Cc Srinivas Pandruvada <[email protected]>
Cc Aubrey Li <[email protected]>
Cc Haowen Bai <[email protected]>
Signed-off-by Ricardo Neri <[email protected]>
--- drivers/thermal/intel/intel_hfi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/intel/intel_hfi.c +1 -1
@@ -371,7 +371,7 @@ void intel_hfi_online(unsigned int cpu) die_id =topology_logical_die_id (cpu); hfi_instance = info->hfi_instance;if (!hfi_instance) { -if (die_id <0 || die_id >= max_hfi_instances) +if (die_id >= max_hfi_instances)return ; hfi_instance = &hfi_instances[die_id];
Signature · 1 line
2.25.1
Quoted 25 lines · Ricardo Neri
die_idis an u16 quantity. On single-die systems the default value ofdie_idis 0. No need to check for negative values.Plus, removing this check makes Coverity happy.
Cc Daniel Lezcano <[email protected]>Cc Amit Kucheria <[email protected]>Cc Zhang Rui <[email protected]>Cc Len Brown <[email protected]>Cc Srinivas Pandruvada <[email protected]>Cc Aubrey Li <[email protected]>Cc Haowen Bai <[email protected]>Signed-off-by Ricardo Neri <[email protected]>--- drivers/thermal/intel/intel_hfi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/thermal/intel/intel_hfi.c +0
-0
drivers/thermal/intel/intel_hfi.c void intel_hfi_online(unsigned int cpu)
Quoted 9 lines
drivers/thermal/intel/intel_hfi.c +1
-2@@ -371,7 +371,7 @@ void intel_hfi_online(unsigned int cpu) die_id =topology_logical_die_id (cpu); hfi_instance = info->hfi_instance;if (!hfi_instance) { -if (die_id <0 || die_id >= max_hfi_instances) +if (die_id >= max_hfi_instances)return ; hfi_instance = &hfi_instances[die_id]; --
Applied as 6.2 material, thanks!