diff mbox series

net: udp: remove redundant initialization in udp_send_skb

Message ID 1604644960-48378-4-git-send-email-dong.menglong@zte.com.cn
State Accepted
Delegated to: David Miller
Headers show
Series net: udp: remove redundant initialization in udp_send_skb | expand

Checks

Context Check Description
jkicinski/header_inline success Link
jkicinski/cover_letter success Link
jkicinski/fixes_present success Link
jkicinski/patch_count success Link
jkicinski/tree_selection success Guessed tree name to be net-next
jkicinski/subject_prefix warning Target tree name not specified in the subject
jkicinski/source_inline success Was 0 now: 0
jkicinski/verify_signedoff success Link
jkicinski/module_param success Was 0 now: 0
jkicinski/build_32bit success Errors and warnings before: 9 this patch: 9
jkicinski/kdoc success Errors and warnings before: 0 this patch: 0
jkicinski/verify_fixes success Link
jkicinski/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
jkicinski/build_allmodconfig_warn success Errors and warnings before: 9 this patch: 9
jkicinski/stable success Stable not CCed

Commit Message

Menglong Dong Nov. 6, 2020, 6:42 a.m. UTC
From: Menglong Dong <dong.menglong@zte.com.cn>

The initialization for 'err' with 0 is redundant and can be removed,
as it is updated by ip_send_skb and not used before that.

Signed-off-by: Menglong Dong <dong.menglong@zte.com.cn>
---
 net/ipv4/udp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jakub Kicinski Nov. 10, 2020, 1:13 a.m. UTC | #1
On Fri,  6 Nov 2020 01:42:40 -0500 menglong8.dong@gmail.com wrote:
> From: Menglong Dong <dong.menglong@zte.com.cn>
> 
> The initialization for 'err' with 0 is redundant and can be removed,
> as it is updated by ip_send_skb and not used before that.
> 
> Signed-off-by: Menglong Dong <dong.menglong@zte.com.cn>

Applied.
diff mbox series

Patch

diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index ca04a8a..6953688 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -874,7 +874,7 @@  static int udp_send_skb(struct sk_buff *skb, struct flowi4 *fl4,
 	struct sock *sk = skb->sk;
 	struct inet_sock *inet = inet_sk(sk);
 	struct udphdr *uh;
-	int err = 0;
+	int err;
 	int is_udplite = IS_UDPLITE(sk);
 	int offset = skb_transport_offset(skb);
 	int len = skb->len - offset;