]> git.ipfire.org Git - thirdparty/iproute2.git/commit
tc: q_ets: drop dead code from argument parsing
authorAndrea Claudi <aclaudi@redhat.com>
Sat, 1 May 2021 16:44:35 +0000 (18:44 +0200)
committerDavid Ahern <dsahern@kernel.org>
Thu, 6 May 2021 14:42:44 +0000 (14:42 +0000)
commita2f1f66075c830a3c67544c7f36ed4411d64cd86
tree885249f00c5a79e0b62e3d8ab635f2bad30afd91
parent570d2cf0ec9e971867e2e9bbd4e774f098aa22b3
tc: q_ets: drop dead code from argument parsing

Checking for nbands to be at least 1 at this point is useless. Indeed:
- ets requires "bands", "quanta" or "strict" to be specified
- if "bands" is specified, nbands cannot be negative, see parse_nbands()
- if "strict" is specified, nstrict cannot be negative, see
  parse_nbands()
- if "quantum" is specified, nquanta cannot be negative, see
  parse_quantum()
- if "bands" is not specified, nbands is set to nstrict+nquanta
- the previous if statement takes care of the case when none of them are
  specified and nbands is 0, terminating execution.

Thus nbands cannot be < 1 at this point and this code cannot be executed.

Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
tc/q_ets.c