All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH iproute2] q_cake: remove useless check on argv
@ 2021-04-13 22:50 Andrea Claudi
  0 siblings, 0 replies; only message in thread
From: Andrea Claudi @ 2021-04-13 22:50 UTC (permalink / raw)
  To: netdev; +Cc: stephen, dsahern

In cake_parse_opt(), *argv is checked not to be null when parsing for
overhead and mpu parameters. However this is useless, since *argv
matches right before for "overhead" or "mpu".

Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
---
 tc/q_cake.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tc/q_cake.c b/tc/q_cake.c
index 4ff6056a..4cfc1c00 100644
--- a/tc/q_cake.c
+++ b/tc/q_cake.c
@@ -299,8 +299,7 @@ static int cake_parse_opt(struct qdisc_util *qu, int argc, char **argv,
 
 			NEXT_ARG();
 			overhead = strtol(*argv, &p, 10);
-			if (!p || *p || !*argv ||
-			    overhead < -64 || overhead > 256) {
+			if (!p || *p || overhead < -64 || overhead > 256) {
 				fprintf(stderr,
 					"Illegal \"overhead\", valid range is -64 to 256\\n");
 				return -1;
@@ -312,7 +311,7 @@ static int cake_parse_opt(struct qdisc_util *qu, int argc, char **argv,
 
 			NEXT_ARG();
 			mpu = strtol(*argv, &p, 10);
-			if (!p || *p || !*argv || mpu < 0 || mpu > 256) {
+			if (!p || *p || mpu < 0 || mpu > 256) {
 				fprintf(stderr,
 					"Illegal \"mpu\", valid range is 0 to 256\\n");
 				return -1;
-- 
2.30.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-13 22:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-13 22:50 [PATCH iproute2] q_cake: remove useless check on argv Andrea Claudi

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.