[git commit] hdparm: fix a thinko in a previous commit

Denys Vlasenko vda.linux at googlemail.com
Wed May 20 21:21:42 UTC 2009


commit: http://git.busybox.net/busybox/commit/?id=2b132e5139ab3cf437d2954a9a21204129e3778b
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master


Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 miscutils/hdparm.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/miscutils/hdparm.c b/miscutils/hdparm.c
index 7034778..0d374ca 100644
--- a/miscutils/hdparm.c
+++ b/miscutils/hdparm.c
@@ -1464,7 +1464,8 @@ static void interpret_standby(uint8_t standby)
 		printf("off");
 	} else if (standby <= 240 || standby == 252 || standby == 255) {
 		/* standby is in 5 sec units */
-		printf("%u minutes %u seconds", standby / (60/5), standby % (60/5));
+		unsigned t = standby * 5;
+		printf("%u minutes %u seconds", t / 60, t % 60);
 	} else if (standby <= 251) {
 		unsigned t = (standby - 240); /* t is in 30 min units */;
 		printf("%u.%c hours", t / 2, (t & 1) ? '5' : '0');
-- 
1.6.0.6


More information about the busybox-cvs mailing list