netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steffen Klassert <steffen.klassert@secunet.com>
To: David Miller <davem@davemloft.net>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	Steffen Klassert <steffen.klassert@secunet.com>,
	<netdev@vger.kernel.org>
Subject: [PATCH 6/8] esp6: remove redundant initialization of esph
Date: Mon, 30 Oct 2017 09:39:33 +0100	[thread overview]
Message-ID: <1509352775-9563-7-git-send-email-steffen.klassert@secunet.com> (raw)
In-Reply-To: <1509352775-9563-1-git-send-email-steffen.klassert@secunet.com>

From: Colin Ian King <colin.king@canonical.com>

The pointer esph is being initialized with a value that is never
read and then being updated.  Remove the redundant initialization
and move the declaration and initializtion of esph to the local
code block.

Cleans up clang warning:
net/ipv6/esp6.c:562:21: warning: Value stored to 'esph' during its
initialization is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/ipv6/esp6.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index 89910e2..1696401 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -559,14 +559,14 @@ static void esp_input_restore_header(struct sk_buff *skb)
 static void esp_input_set_header(struct sk_buff *skb, __be32 *seqhi)
 {
 	struct xfrm_state *x = xfrm_input_state(skb);
-	struct ip_esp_hdr *esph = (struct ip_esp_hdr *)skb->data;
 
 	/* For ESN we move the header forward by 4 bytes to
 	 * accomodate the high bits.  We will move it back after
 	 * decryption.
 	 */
 	if ((x->props.flags & XFRM_STATE_ESN)) {
-		esph = skb_push(skb, 4);
+		struct ip_esp_hdr *esph = skb_push(skb, 4);
+
 		*seqhi = esph->spi;
 		esph->spi = esph->seq_no;
 		esph->seq_no = XFRM_SKB_CB(skb)->seq.input.hi;
-- 
2.7.4

  parent reply	other threads:[~2017-10-30  8:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-30  8:39 pull request (net-next): ipsec-next 2017-10-30 Steffen Klassert
2017-10-30  8:39 ` [PATCH 1/8] xfrm: make aead_len() return unsigned int Steffen Klassert
2017-10-30  8:39 ` [PATCH 2/8] xfrm: make xfrm_alg_len() " Steffen Klassert
2017-10-30  8:39 ` [PATCH 3/8] xfrm: make xfrm_alg_auth_len() " Steffen Klassert
2017-10-30  8:39 ` [PATCH 4/8] xfrm: make xfrm_replay_state_esn_len() " Steffen Klassert
2017-10-30  8:39 ` [PATCH 5/8] xfrm: eradicate size_t Steffen Klassert
2017-10-30  8:39 ` Steffen Klassert [this message]
2017-10-30  8:39 ` [PATCH 7/8] net: xfrm_user: use BUG_ON instead of if condition followed by BUG Steffen Klassert
2017-10-30  8:39 ` [PATCH 8/8] ipv6: esp6: " Steffen Klassert
2017-11-01  3:17 ` pull request (net-next): ipsec-next 2017-10-30 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1509352775-9563-7-git-send-email-steffen.klassert@secunet.com \
    --to=steffen.klassert@secunet.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).