From: Jean Sacren Date: Thu, 28 Oct 2021 18:24:53 +0000 (-0600) Subject: net: bareudp: fix duplicate checks of data[] expressions X-Git-Tag: v6.6.17~8953^2~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5bd663212f2e455f87368cc3a51bee72411499f4;p=platform%2Fkernel%2Flinux-rpi.git net: bareudp: fix duplicate checks of data[] expressions Both !data[IFLA_BAREUDP_PORT] and !data[IFLA_BAREUDP_ETHERTYPE] are checked. We should remove the checks of data[IFLA_BAREUDP_PORT] and data[IFLA_BAREUDP_ETHERTYPE] that follow since they are always true. Put both statements together in group and balance the space on both sides of '=' sign. Signed-off-by: Jean Sacren Signed-off-by: David S. Miller --- diff --git a/drivers/net/bareudp.c b/drivers/net/bareudp.c index 54e321a..edffc34 100644 --- a/drivers/net/bareudp.c +++ b/drivers/net/bareudp.c @@ -577,11 +577,8 @@ static int bareudp2info(struct nlattr *data[], struct bareudp_conf *conf, return -EINVAL; } - if (data[IFLA_BAREUDP_PORT]) - conf->port = nla_get_u16(data[IFLA_BAREUDP_PORT]); - - if (data[IFLA_BAREUDP_ETHERTYPE]) - conf->ethertype = nla_get_u16(data[IFLA_BAREUDP_ETHERTYPE]); + conf->port = nla_get_u16(data[IFLA_BAREUDP_PORT]); + conf->ethertype = nla_get_u16(data[IFLA_BAREUDP_ETHERTYPE]); if (data[IFLA_BAREUDP_SRCPORT_MIN]) conf->sport_min = nla_get_u16(data[IFLA_BAREUDP_SRCPORT_MIN]);