mirror of
https://github.com/martijnvanbrummelen/nwipe.git
synced 2026-02-20 13:42:14 +00:00
fixed min/max wrong set
This commit is contained in:
@@ -88,8 +88,7 @@ int nwipe_init_scsi_temperature( nwipe_context_t* c )
|
||||
c->temp1_lcrit = -40; /* just to give it a value with some kind of sense */
|
||||
c->temp1_highest = dsk->value;
|
||||
c->temp1_lowest = dsk->value;
|
||||
c->temp1_min = dsk->value;
|
||||
c->temp1_max = dsk->value;
|
||||
c->temp1_max = dsk->refvalue - 5; /* seems to be kind of useful */
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -116,30 +115,19 @@ int nwipe_get_scsi_temperature( nwipe_context_t* c )
|
||||
if( scsi_get_temperature( dsk ) == GETTEMP_SUCCESS )
|
||||
{
|
||||
c->temp1_input = dsk->value;
|
||||
if( c->temp1_max == NO_TEMPERATURE_DATA )
|
||||
|
||||
/* not at all of interest */
|
||||
if( c->temp1_input > c->temp1_highest )
|
||||
{
|
||||
c->temp1_max = c->temp1_input;
|
||||
c->temp1_highest = c->temp1_input;
|
||||
}
|
||||
else
|
||||
if( c->temp1_input < c->temp1_lowest )
|
||||
{
|
||||
if( c->temp1_input > c->temp1_max )
|
||||
{
|
||||
c->temp1_max = c->temp1_input;
|
||||
c->temp1_highest = c->temp1_input;
|
||||
}
|
||||
}
|
||||
if( c->temp1_min == NO_TEMPERATURE_DATA )
|
||||
{
|
||||
c->temp1_min = c->temp1_input;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( c->temp1_input < c->temp1_min )
|
||||
{
|
||||
c->temp1_min = c->temp1_input;
|
||||
c->temp1_lowest = c->temp1_input;
|
||||
}
|
||||
c->temp1_lowest = c->temp1_input;
|
||||
}
|
||||
|
||||
/* end not at all of interest ;-) */
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user