Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp478072imm; Fri, 17 Aug 2018 01:02:11 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxEPv2+qpWd5GmSkKOfIjyM56v6Lc+wI9OzRANpZTjArPl//pH6L1YBzQHA98shVun5CbQI X-Received: by 2002:a63:24c:: with SMTP id 73-v6mr32698181pgc.252.1534492931270; Fri, 17 Aug 2018 01:02:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534492931; cv=none; d=google.com; s=arc-20160816; b=esehIMBAPLdaPQFwiwjC+Seo8/mtY//aBqgM6AofLBjs1X2pvgP+e6zQzPtAjedE4b O956G8WwS22COop6v4s9Bz0oWPFxcy8UdiRBxzHwfIvFO3grEoGpCboLEG2IpYaM5ME5 MBs8zLn8cH2DlcAyLQtjHnswYemMHRIL0b+oHRhjMkDCszT7JDPiC+VEQXIlyiAiGfs2 +PbPNn7/zgskyxdLgD58SQ+b90B6q3NV4WZAmVR7ZH86dFHe9Mg5P8RfmaCmE/dvrEXV EmWcHx1n8qUyVpXMRhBWZu4yFiam04NhCDFuBTJEPVx7/FNnxkwrp47Igwe9deIHpeA9 8oyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=5vghuaK3U6FEsrFCRToEV2uhzzlhTZbM9sprlQfEtXI=; b=xVgh2LJbgiN5VBkXutZkXUhFvVoASzjrSJKqwbBy3UfsYYnII2psncBuWTIXfgqOUm wzgYsrPxvDVqqTZ1HCd3bnlZHWKwBORpjxOsCMj5PZ1NwQVnPZBw/HUVWZuTaxwbx9hQ VwGizXVQ3T4KyL7rLKRrxEZbCzB4z+wCdqO92HmyaeXSZ7e8sVCdYOHz2h+/BxIMOXa/ TN1ZcH23G72KCiGheBy5UQYML/QbvYeALRKv8Hrh3jtTpoZVuBDc1oLIyoZ2p3geLQPH oW/rZY3ucyXLm7TJ0iFyDb8IYUBlHfMLzIbcstRjTQl7J0u+IA2tvR3sYCqoz3uL2Tdy LBGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c10-v6si1452239pgg.315.2018.08.17.01.01.55; Fri, 17 Aug 2018 01:02:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726682AbeHQLDM (ORCPT + 99 others); Fri, 17 Aug 2018 07:03:12 -0400 Received: from cmccmta1.chinamobile.com ([221.176.66.79]:56055 "EHLO cmccmta1.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726349AbeHQLDM (ORCPT ); Fri, 17 Aug 2018 07:03:12 -0400 X-Greylist: delayed 549 seconds by postgrey-1.27 at vger.kernel.org; Fri, 17 Aug 2018 07:03:06 EDT Received: from spf.mail.chinamobile.com (unknown[172.16.121.17]) by rmmx-syy-dmz-app04-12004 (RichMail) with SMTP id 2ee45b767e838a6-362be; Fri, 17 Aug 2018 15:51:32 +0800 (CST) X-RM-TRANSID: 2ee45b767e838a6-362be X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost (unknown[223.105.0.240]) by rmsmtp-syy-appsvr09-12009 (RichMail) with SMTP id 2ee95b767e83dda-71e84; Fri, 17 Aug 2018 15:51:32 +0800 (CST) X-RM-TRANSID: 2ee95b767e83dda-71e84 From: Haishuang Yan To: Steffen Klassert , Herbert Xu , "David S. Miller" Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Haishuang Yan Subject: [PATCH net-next] esp: remove redundant define esph Date: Fri, 17 Aug 2018 15:51:00 +0800 Message-Id: <1534492260-2639-1-git-send-email-yanhaishuang@cmss.chinamobile.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The pointer 'esph' is defined but is never used hence it is redundant and canbe removed. Signed-off-by: Haishuang Yan --- net/ipv4/esp4.c | 7 +++---- net/ipv6/esp6.c | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c index 9768901..211caaf 100644 --- a/net/ipv4/esp4.c +++ b/net/ipv4/esp4.c @@ -683,12 +683,11 @@ static void esp_input_done_esn(struct crypto_async_request *base, int err) */ static int esp_input(struct xfrm_state *x, struct sk_buff *skb) { - struct ip_esp_hdr *esph; struct crypto_aead *aead = x->data; struct aead_request *req; struct sk_buff *trailer; int ivlen = crypto_aead_ivsize(aead); - int elen = skb->len - sizeof(*esph) - ivlen; + int elen = skb->len - sizeof(struct ip_esp_hdr) - ivlen; int nfrags; int assoclen; int seqhilen; @@ -698,13 +697,13 @@ static int esp_input(struct xfrm_state *x, struct sk_buff *skb) struct scatterlist *sg; int err = -EINVAL; - if (!pskb_may_pull(skb, sizeof(*esph) + ivlen)) + if (!pskb_may_pull(skb, sizeof(struct ip_esp_hdr) + ivlen)) goto out; if (elen <= 0) goto out; - assoclen = sizeof(*esph); + assoclen = sizeof(struct ip_esp_hdr); seqhilen = 0; if (x->props.flags & XFRM_STATE_ESN) { diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c index 88a7579..63b2b66 100644 --- a/net/ipv6/esp6.c +++ b/net/ipv6/esp6.c @@ -601,12 +601,11 @@ static void esp_input_done_esn(struct crypto_async_request *base, int err) static int esp6_input(struct xfrm_state *x, struct sk_buff *skb) { - struct ip_esp_hdr *esph; struct crypto_aead *aead = x->data; struct aead_request *req; struct sk_buff *trailer; int ivlen = crypto_aead_ivsize(aead); - int elen = skb->len - sizeof(*esph) - ivlen; + int elen = skb->len - sizeof(struct ip_esp_hdr) - ivlen; int nfrags; int assoclen; int seqhilen; @@ -616,7 +615,7 @@ static int esp6_input(struct xfrm_state *x, struct sk_buff *skb) u8 *iv; struct scatterlist *sg; - if (!pskb_may_pull(skb, sizeof(*esph) + ivlen)) { + if (!pskb_may_pull(skb, sizeof(struct ip_esp_hdr) + ivlen)) { ret = -EINVAL; goto out; } @@ -626,7 +625,7 @@ static int esp6_input(struct xfrm_state *x, struct sk_buff *skb) goto out; } - assoclen = sizeof(*esph); + assoclen = sizeof(struct ip_esp_hdr); seqhilen = 0; if (x->props.flags & XFRM_STATE_ESN) { -- 1.8.3.1