Skip to content

Commit

Permalink
Fix CID 168996: Logically dead code.
Browse files Browse the repository at this point in the history
slot_delta_rtime can not be zero, thus conditional is redundant.
  • Loading branch information
aabc committed May 10, 2017
1 parent 1fdbe98 commit 9ce0149
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions xt_ratelimit.c
Expand Up @@ -179,8 +179,7 @@ unsigned long calc_rate_est(const struct ratelimit_stat *stat)
{
const unsigned int slot_delta_rtime = RATEST_JIFFIES - (now % RATEST_JIFFIES);
#define SMOOTH_VAUE 10 /* smoothen integer arithmetics */
const unsigned int prev_ratio = (slot_delta_rtime)?
RATEST_JIFFIES * SMOOTH_VAUE / slot_delta_rtime : SMOOTH_VAUE;
const unsigned int prev_ratio = RATEST_JIFFIES * SMOOTH_VAUE / slot_delta_rtime;

bps = bps * SMOOTH_VAUE / prev_ratio;
bps += cur_bytes;
Expand Down

0 comments on commit 9ce0149

Please sign in to comment.