mirror of git://git.sysmocom.de/ofono
Be more numerically stable
This commit is contained in:
parent
e5f02e427a
commit
d0501c5694
|
@ -480,7 +480,7 @@ static inline void report_signal_strength(struct ofono_netreg *netreg,
|
||||||
if (strength == 99)
|
if (strength == 99)
|
||||||
strength = -1;
|
strength = -1;
|
||||||
else
|
else
|
||||||
strength = strength * 100 / 31;
|
strength = (strength * 100) / 31;
|
||||||
|
|
||||||
ofono_netreg_strength_notify(netreg, strength);
|
ofono_netreg_strength_notify(netreg, strength);
|
||||||
}
|
}
|
||||||
|
@ -553,7 +553,7 @@ static void csq_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||||
if (strength == 99)
|
if (strength == 99)
|
||||||
strength = -1;
|
strength = -1;
|
||||||
else
|
else
|
||||||
strength = strength * 100 / 31;
|
strength = (strength * 100) / 31;
|
||||||
|
|
||||||
cb(&error, strength, cbd->data);
|
cb(&error, strength, cbd->data);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue