netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [iproute2 PATCH 2/2] tc: Use correct variable type for get_distribution() result
@ 2011-11-23 21:15 Thomas Jarosch
  2011-11-23 22:48 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Jarosch @ 2011-11-23 21:15 UTC (permalink / raw)
  To: netdev, shemminger

get_distribution() returns an int.

cppcheck reported:
[tc/q_netem.c:243]: (style) Checking if unsigned variable 'dist_size' is less than zero.

The mismatch actually rendered the error checking
after get_distribution() ineffective.

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
---
 tc/q_netem.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tc/q_netem.c b/tc/q_netem.c
index 01639a8..6dc40bd 100644
--- a/tc/q_netem.c
+++ b/tc/q_netem.c
@@ -125,7 +125,7 @@ static int get_ticks(__u32 *ticks, const char *str)
 static int netem_parse_opt(struct qdisc_util *qu, int argc, char **argv,
 			   struct nlmsghdr *n)
 {
-	size_t dist_size = 0;
+	int dist_size = 0;
 	struct rtattr *tail;
 	struct tc_netem_qopt opt;
 	struct tc_netem_corr cor;
-- 
1.7.6.4

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

* Re: [iproute2 PATCH 2/2] tc: Use correct variable type for get_distribution() result
  2011-11-23 21:15 [iproute2 PATCH 2/2] tc: Use correct variable type for get_distribution() result Thomas Jarosch
@ 2011-11-23 22:48 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2011-11-23 22:48 UTC (permalink / raw)
  To: Thomas Jarosch; +Cc: netdev

On Wed, 23 Nov 2011 22:15:19 +0100
Thomas Jarosch <thomas.jarosch@intra2net.com> wrote:

> get_distribution() returns an int.
> 
> cppcheck reported:
> [tc/q_netem.c:243]: (style) Checking if unsigned variable 'dist_size' is less than zero.
> 

Both applied, thanks.

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

end of thread, other threads:[~2011-11-23 22:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-23 21:15 [iproute2 PATCH 2/2] tc: Use correct variable type for get_distribution() result Thomas Jarosch
2011-11-23 22:48 ` 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).