summaryrefslogtreecommitdiff
path: root/pkg/iproute2/patch/0003-Don-t-return-expression-in-function-returning-void.patch
blob: 55c4ea7af74d0b76c27aaaa62e26309de2d583b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From 1b0100dc4efba66f64b64ff86cb25c9312da2848 Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Sun, 16 Jun 2019 12:14:23 -0700
Subject: [PATCH] Don't return expression in function returning void

---
 ip/iplink_xdp.c | 8 +++++---
 ip/ipxfrm.c     | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/ip/iplink_xdp.c b/ip/iplink_xdp.c
index 5928dff7..8fe35def 100644
--- a/ip/iplink_xdp.c
+++ b/ip/iplink_xdp.c
@@ -164,9 +164,11 @@ void xdp_dump(FILE *fp, struct rtattr *xdp, bool link, bool details)
 	mode = rta_getattr_u8(tb[IFLA_XDP_ATTACHED]);
 	if (mode == XDP_ATTACHED_NONE)
 		return;
-	else if (is_json_context())
-		return details ? (void)0 : xdp_dump_json(tb);
-	else if (details && link)
+	else if (is_json_context()) {
+		if (details)
+			xdp_dump_json(tb);
+		return;
+	} else if (details && link)
 		/* don't print mode */;
 	else if (mode == XDP_ATTACHED_DRV)
 		fprintf(fp, "xdp");
diff --git a/ip/ipxfrm.c b/ip/ipxfrm.c
index b78c712d..c3a5986f 100644
--- a/ip/ipxfrm.c
+++ b/ip/ipxfrm.c
@@ -526,7 +526,7 @@ static void __xfrm_algo_print(struct xfrm_algo *algo, int type, int len,
 static inline void xfrm_algo_print(struct xfrm_algo *algo, int type, int len,
 				   FILE *fp, const char *prefix, bool nokeys)
 {
-	return __xfrm_algo_print(algo, type, len, fp, prefix, 1, nokeys);
+	__xfrm_algo_print(algo, type, len, fp, prefix, 1, nokeys);
 }
 
 static void xfrm_aead_print(struct xfrm_algo_aead *algo, int len,
-- 
2.44.0