Skip to content

Commit d2a2d93

Browse files
committed
mctpd: remove unnecessary else block
The if will return in all paths, no need for the `else`. Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
1 parent af129e9 commit d2a2d93

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/mctpd.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,15 +1621,13 @@ static int add_peer(struct ctx *ctx, const dest_phys *dest, mctp_eid_t eid,
16211621
}
16221622
*ret_peer = peer;
16231623
return 0;
1624-
} else {
1625-
/* only LearnEndpoint methods of au.com.codeconstruct.MCTP.Network1
1626-
* interface will approve peer structure if eid belongs to a bridge
1627-
* pool space else never allow.
1628-
*/
1629-
if (!net_learn & is_eid_in_bridge_pool(n, ctx, eid)) {
1630-
return -EEXIST;
1631-
}
16321624
}
1625+
/* only LearnEndpoint methods of au.com.codeconstruct.MCTP.Network1
1626+
* interface will approve peer structure if eid belongs to a bridge
1627+
* pool space else never allow.
1628+
*/
1629+
if (!net_learn & is_eid_in_bridge_pool(n, ctx, eid))
1630+
return -EEXIST;
16331631

16341632
if (ctx->num_peers == MAX_PEER_SIZE)
16351633
return -ENOMEM;

0 commit comments

Comments
 (0)