* [PATCH net-next] net: bareudp: fix duplicate checks of data[] expressions
@ 2021-10-28 18:24 Jεan Sacren
2021-10-29 12:50 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Jεan Sacren @ 2021-10-28 18:24 UTC (permalink / raw)
To: davem, kuba, netdev
From: Jean Sacren <sakiwit@gmail.com>
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 <sakiwit@gmail.com>
---
drivers/net/bareudp.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/bareudp.c b/drivers/net/bareudp.c
index 54e321a695ce..edffc3489a12 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]);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: bareudp: fix duplicate checks of data[] expressions
2021-10-28 18:24 [PATCH net-next] net: bareudp: fix duplicate checks of data[] expressions Jεan Sacren
@ 2021-10-29 12:50 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-10-29 12:50 UTC (permalink / raw)
To: =?utf-8?q?J=CE=B5an_Sacren_=3Csakiwit=40gmail=2Ecom=3E?=
Cc: davem, kuba, netdev
Hello:
This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:
On Thu, 28 Oct 2021 12:24:53 -0600 you wrote:
> From: Jean Sacren <sakiwit@gmail.com>
>
> 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.
>
> [...]
Here is the summary with links:
- [net-next] net: bareudp: fix duplicate checks of data[] expressions
https://git.kernel.org/netdev/net-next/c/5bd663212f2e
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-10-29 12:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-28 18:24 [PATCH net-next] net: bareudp: fix duplicate checks of data[] expressions Jεan Sacren
2021-10-29 12:50 ` patchwork-bot+netdevbpf
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.