projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d8aeba4
)
hdparm: fix a thinko in a previous commit
author
Denys Vlasenko
<vda.linux@googlemail.com>
Wed, 20 May 2009 21:21:42 +0000
(23:21 +0200)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Wed, 20 May 2009 21:21:42 +0000
(23:21 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
miscutils/hdparm.c
patch
|
blob
|
history
diff --git
a/miscutils/hdparm.c
b/miscutils/hdparm.c
index 7034778e71a50485f9ec376c9c0cd2dd062e5bbd..0d374ca4ae7ff8e550000dd00f3ea23ef0905d73 100644
(file)
--- 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');