All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leslie Monis <lesliemonis@gmail.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, tahiliani@nitk.edu.in, gautamramk@gmail.com
Subject: [PATCH net-next v2 2/4] pie: remove unnecessary type casting
Date: Thu,  5 Mar 2020 00:26:00 +0530	[thread overview]
Message-ID: <20200304185602.2540-3-lesliemonis@gmail.com> (raw)
In-Reply-To: <20200304185602.2540-1-lesliemonis@gmail.com>

In function pie_calculate_probability(), the variables alpha and
beta are of type u64. The variables qdelay, qdelay_old and
params->target are of type psched_time_t (which is also u64).
The explicit type casting done when calculating the value for
the variable delta is redundant and not required.

Signed-off-by: Mohit P. Tahiliani <tahiliani@nitk.edu.in>
Signed-off-by: Gautam Ramakrishnan <gautamramk@gmail.com>
Signed-off-by: Leslie Monis <lesliemonis@gmail.com>
---
 net/sched/sch_pie.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/sched/sch_pie.c b/net/sched/sch_pie.c
index 8a2f9f11c86f..198cfa34a00a 100644
--- a/net/sched/sch_pie.c
+++ b/net/sched/sch_pie.c
@@ -363,8 +363,8 @@ void pie_calculate_probability(struct pie_params *params, struct pie_vars *vars,
 	}
 
 	/* alpha and beta should be between 0 and 32, in multiples of 1/16 */
-	delta += alpha * (u64)(qdelay - params->target);
-	delta += beta * (u64)(qdelay - qdelay_old);
+	delta += alpha * (qdelay - params->target);
+	delta += beta * (qdelay - qdelay_old);
 
 	oldprob = vars->prob;
 
-- 
2.17.1


  parent reply	other threads:[~2020-03-04 18:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-04 18:55 [PATCH net-next v2 0/4] pie: minor improvements Leslie Monis
2020-03-04 18:55 ` [PATCH net-next v2 1/4] pie: use term backlog instead of qlen Leslie Monis
2020-03-04 18:56 ` Leslie Monis [this message]
2020-03-04 18:56 ` [PATCH net-next v2 3/4] pie: remove pie_vars->accu_prob_overflows Leslie Monis
2020-03-04 18:56 ` [PATCH net-next v2 4/4] pie: realign comment Leslie Monis
2020-03-04 20:49 ` [PATCH net-next v2 0/4] pie: minor improvements Jakub Kicinski
2020-03-04 21:26   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200304185602.2540-3-lesliemonis@gmail.com \
    --to=lesliemonis@gmail.com \
    --cc=davem@davemloft.net \
    --cc=gautamramk@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=tahiliani@nitk.edu.in \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.