From patchwork Sat Jun 12 14:37:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 459164 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp1859475jae; Sat, 12 Jun 2021 07:38:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSOGjHVxDEkaqIQ8wWucwaKvyW9XcDTmDy7uTuWj+w9kkOLULEIVuWqYp98e5CnDupINJ6 X-Received: by 2002:a17:906:8a55:: with SMTP id gx21mr8192593ejc.179.1623508736550; Sat, 12 Jun 2021 07:38:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623508736; cv=none; d=google.com; s=arc-20160816; b=DZb3t88xHzO1yhR6PEXzl3Q3vGrx+r3X6h8bLwpV+9LWfIvx7+7jfjLduIM/F9eqMZ kPVVK2KmLiu/ypb1m2XjEFtcaTmdG2LTHri/yVH71I+9NsJBS8NJGwnSYo3TwTlcbSpW aOoO6IjXwcxuP+B5ZWKZsonsJMF86AG+DErI6VBIxTeN05IpMKGlwN7gRKpiqhnSJL/G jHQRH+gqXf/yDy42B8KD55iN/MnoUBs/JD7pkYCgbtB/5aJQIWHWvpUYkzBrRyhtnLeP uHZrrvlOJhWkjXNbK5kktWYPHZas36tW77YF/Tw23IFMilC5UlAqxWJ2E+neZ1sVwg2P 7t8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6MPm/CDH/wz97xhLG1zwJ5+gY1yCELg1LNPAC/aA5x8=; b=befz1qYu4zBlnajkN+uSggd3k9fAk3n528yck+bliZ8HsqtA59NJP+Xu9iO0ZNlEWc hsRP19/EP0DTDe8KLywGVro8ftU/9ap8/I1UfNqJf/bj1KTfv+FfuKL528Xv/vmGKP4k HJxTgpwc5gbisRRiMBqoa1RPxWKQDF81nBe48qhRz8pVKzBIhevB1RNDuMHHVNZZ6Qxb PbblnA4goSqrb6kB+HGThXAjrN+g1qaKY8s8/ycaaLqwn/mGS9ssediTYFFty0yZOl6u ELRXBhHqqCTrtqgVUKB1YSB/uDlHIJkGQUznG8T+2s9u8qe2xiYJqrfqiYwzpYzFdD7d b7iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pCoXZqOC; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ly22si7281996ejb.565.2021.06.12.07.38.56; Sat, 12 Jun 2021 07:38:56 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pCoXZqOC; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231423AbhFLOj4 (ORCPT + 8 others); Sat, 12 Jun 2021 10:39:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231408AbhFLOjx (ORCPT ); Sat, 12 Jun 2021 10:39:53 -0400 Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D22DC061767 for ; Sat, 12 Jun 2021 07:37:42 -0700 (PDT) Received: by mail-il1-x135.google.com with SMTP id b9so8162068ilr.2 for ; Sat, 12 Jun 2021 07:37:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6MPm/CDH/wz97xhLG1zwJ5+gY1yCELg1LNPAC/aA5x8=; b=pCoXZqOCkaUfU2CKczK/N5M4NvRp5vOr3O96/Aj4IvXXFyqcuvkvtGtSbs9Z15v7Bq 7woSGdi9JzMR4m6QYiBQ5fi15KABSdUHyXBU/IiKAt7KWXeMW5Xno69yLZYBPgUWHoc9 NI4TpJwAY/mHm7AO/AYqeBNfeMmd19JvccI+9VpmQFCXxzoFi+7wj8ZHn3nAeml5fNge xfkZUDwC3/IoRDOCpVnh4uLfJC0vX1IMsAwbU0xRhfKc2hsLyyDSD7E79CGD1Ls7tjlV z8cZUoOpbwISZ6aQgaVbg8pZxXzPXVUozj/IaRubNMm6RqWUH62fnyv8UdZ0iMYsBRFf y6zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6MPm/CDH/wz97xhLG1zwJ5+gY1yCELg1LNPAC/aA5x8=; b=QcxmwnzaQfEKe8//4/8heX8N/ULTJuSyzsIsAMZ58nd4b748EpZs4D5dNQ/3ZDwcfY SUCewIE8eHXBZkMoJPMopCAJXJiTZwk2/934Vm/ryoKzEj3vUKx3iz56qgBGd8q71C4x to7kwUIeEpZGUWg19zt9mJ9PlvppDFpTf4oVykGhK+KS/B6FX2Ch7QzbGBtPtKv5uw2C 2oJGtWAKzygcgiT8VhTgRhom6IMI/eU1hvVHRYQzkASDNkAQVus4EWjezBrCTgca1flR xSUn6vwZLGv7aTbZK8mbJUeHI6tWwYhUdZpt+k7BsMhQuiZsUi4Pmmls5qegp+zXQ22R YBtQ== X-Gm-Message-State: AOAM5316Lp1Os7GST6o/2LirF0h6UVBMWBRCFPQCNycn5N+UNPMvwUus csPzzTtvjS2n8m7PZCxdcNJ1vQ== X-Received: by 2002:a05:6e02:219d:: with SMTP id j29mr7248404ila.64.1623508661372; Sat, 12 Jun 2021 07:37:41 -0700 (PDT) Received: from presto.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id k4sm5126559ior.55.2021.06.12.07.37.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Jun 2021 07:37:41 -0700 (PDT) From: Alex Elder To: subashab@codeaurora.org, stranche@codeaurora.org, davem@davemloft.net, kuba@kernel.org Cc: bjorn.andersson@linaro.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 2/8] net: qualcomm: rmnet: rearrange some NOTs Date: Sat, 12 Jun 2021 09:37:30 -0500 Message-Id: <20210612143736.3498712-3-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210612143736.3498712-1-elder@linaro.org> References: <20210612143736.3498712-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org With the ones' complement arithmetic, the sum of two negated values is equal to the negation of the sum of the two original values [1]. Rearrange the calculation ip6_payload_sum using this property. [1] https://tools.ietf.org/html/rfc1071 Signed-off-by: Alex Elder --- drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.27.0 diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c index 3e6feef0fd252..1b170e9189d8a 100644 --- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c +++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c @@ -140,8 +140,8 @@ rmnet_map_ipv6_dl_csum_trailer(struct sk_buff *skb, * checksum computed over the pseudo header. */ ip_header_csum = (__force __be16)ip_fast_csum(ip6h, sizeof(*ip6h) / 4); - ip6_payload_csum = csum16_sub((__force __sum16)~csum_trailer->csum_value, - ~ip_header_csum); + ip6_payload_csum = ~csum16_sub((__force __sum16)csum_trailer->csum_value, + ip_header_csum); length = (ip6h->nexthdr == IPPROTO_UDP) ? ntohs(((struct udphdr *)txporthdr)->len) :