Fixed a division by zero in the Sandforce write amplification sensor.

This commit is contained in:
Michael Möller
2012-02-22 23:36:26 +00:00
parent 71f477d9e6
commit a3dea40fd6
2 changed files with 7 additions and 4 deletions

View File

@@ -92,8 +92,11 @@ namespace OpenHardwareMonitor.Hardware.HDD {
hostWritesToController = RawToInt(value.RawValue, value.AttrValue); hostWritesToController = RawToInt(value.RawValue, value.AttrValue);
} }
if (controllerWritesToNAND.HasValue && hostWritesToController.HasValue) { if (controllerWritesToNAND.HasValue && hostWritesToController.HasValue) {
writeAmplification.Value = if (hostWritesToController.Value > 0)
controllerWritesToNAND.Value / hostWritesToController.Value; writeAmplification.Value =
controllerWritesToNAND.Value / hostWritesToController.Value;
else
writeAmplification.Value = 0;
ActivateSensor(writeAmplification); ActivateSensor(writeAmplification);
} }
} }

View File

@@ -37,5 +37,5 @@
using System.Reflection; using System.Reflection;
[assembly: AssemblyVersion("0.4.0.3")] [assembly: AssemblyVersion("0.4.0.4")]
[assembly: AssemblyInformationalVersion("0.4.0.3 Alpha")] [assembly: AssemblyInformationalVersion("0.4.0.4 Alpha")]