Skip to contentSkip to conversation

tc: fix warning in tc/q_pie.c

PATCH Applied Brian Vazquez 2 participants 2 messages Dec 4, 2019 – Dec 5, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tc: fix warning in tc/q_pie.c

Warning was:
q_pie.c:202:22: error: implicit conversion from 'unsigned long' to 'double'

Fixes 492ec9558b30 ("tc: pie: change maximum integer value of tc_pie_xstats->prob")
Cc Leslie Monis <[email protected]>

---
v2: rebase to current version.

 tc/q_pie.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tc/q_pie.c +1 -1
index 935548a2..fda98a71 100644
@@ -217,7 +217,7 @@ static int pie_print_xstats(struct qdisc_util *qu, FILE *f,
 	st = RTA_DATA(xstats);
 	/*prob is returned as a fracion of maximum integer value */
 	fprintf(f, "prob %f delay %uus",
-		(double)st->prob / UINT64_MAX, st->delay);
+		(double)st->prob / (double)UINT64_MAX, st->delay);
 
 	if (st->dq_rate_estimating)
 		fprintf(f, " avg_dq_rate %u\n", st->avg_dq_rate);
Signature · 1 line
2.24.0.393.g34dc348eaf-goog