netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tc_util: fix incorrect bare number process in get_rate.
@ 2012-07-11  7:24 Li Wei
  2012-07-11 14:51 ` Stephen Hemminger
  0 siblings, 1 reply; 5+ messages in thread
From: Li Wei @ 2012-07-11  7:24 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev


As the comment and manpage indicated that the bare number means
bytes per second, so the division is not needed.
---
 tc/tc_util.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tc/tc_util.c b/tc/tc_util.c
index 926ed08..e8d89c1 100644
--- a/tc/tc_util.c
+++ b/tc/tc_util.c
@@ -153,7 +153,7 @@ int get_rate(unsigned *rate, const char *str)
 		return -1;
 
 	if (*p == '\0') {
-		*rate = bps / 8.;	/* assume bytes/sec */
+		*rate = bps;	/* assume bytes/sec */
 		return 0;
 	}
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-07-12 16:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-11  7:24 [PATCH] tc_util: fix incorrect bare number process in get_rate Li Wei
2012-07-11 14:51 ` Stephen Hemminger
2012-07-12  1:16   ` Li Wei
2012-07-12  1:56   ` [PATCH] tc: man: change man page and comment to confirm to code's behavior Li Wei
2012-07-12 16:06     ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).