All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrea Claudi <aclaudi@redhat.com>
To: netdev@vger.kernel.org
Cc: stephen@networkplumber.org, dsahern@gmail.com, roopa@nvidia.com,
	razor@blackwall.org
Subject: [PATCH iproute2-next] bridge: vni: remove useless checks on vni
Date: Fri, 26 May 2023 19:27:20 +0200	[thread overview]
Message-ID: <ebcffc302b5886a71a3e7aaec4561be2d65de30f.1685095619.git.aclaudi@redhat.com> (raw)

After the (d == NULL || vni == NULL) check, vni cannot be NULL anymore.

This remove two useless conditional checks on vni value:
- the first check cannot be true, so remove the whole conditional block
- the second check is always true, so remove the check

Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
---
 bridge/vni.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/bridge/vni.c b/bridge/vni.c
index 940f251c..77328a4f 100644
--- a/bridge/vni.c
+++ b/bridge/vni.c
@@ -138,14 +138,8 @@ static int vni_modify(int cmd, int argc, char **argv)
 		return -1;
 	}
 
-	if (!vni && group_present) {
-		fprintf(stderr, "Group can only be specified with a vni\n");
-		return -1;
-	}
-
-	if (vni)
-		parse_vni_filter(vni, &req.n, sizeof(req),
-				 (group_present ? &daddr : NULL));
+	parse_vni_filter(vni, &req.n, sizeof(req),
+			 (group_present ? &daddr : NULL));
 
 	req.tmsg.ifindex = ll_name_to_index(d);
 	if (req.tmsg.ifindex == 0) {
-- 
2.40.1


             reply	other threads:[~2023-05-26 17:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-26 17:27 Andrea Claudi [this message]
2023-05-26 19:10 ` [PATCH iproute2-next] bridge: vni: remove useless checks on vni patchwork-bot+netdevbpf

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=ebcffc302b5886a71a3e7aaec4561be2d65de30f.1685095619.git.aclaudi@redhat.com \
    --to=aclaudi@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=razor@blackwall.org \
    --cc=roopa@nvidia.com \
    --cc=stephen@networkplumber.org \
    /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.