Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp465314ybl; Fri, 30 Aug 2019 02:28:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3aQBBnoasJBpaq74HewVorOxOP6W8h0MIq+WmIBotWZOEE9x8z/T8wRCsHRmpwxUAW+k6 X-Received: by 2002:a63:40a:: with SMTP id 10mr12420923pge.317.1567157292395; Fri, 30 Aug 2019 02:28:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567157292; cv=none; d=google.com; s=arc-20160816; b=Coewapp3OP70IrxEpGcvn2QxLjR0BOTeVqJgXBGt3pJLp/jXzShIPRWcIsDq4pf+Vy vuCY567M7caUaj2tGj7078zXMvV2ZRZHj5qKZAi5+bYbjLg8bj/TlC0NV2qgrYmpFV9/ mVm2HO2lP2a7oZfTei3+LlIFr0kCzoXpLn5+VX/K+ZE4cblJFCYH809XQ/bFIM5ZQT+p zXEPT3SNveCS+VzYj9le+GfBMY+vg7d+JMKW0jtXOFDAMbBmHpr/I5ElLOBiu7ixUZTZ Z9e92hf7vD5v8mKNKE/0+Pzvw+hHYAyXljx6TR0d4ubLBc+RiK5v0NpAbjiRCQdTFFMM sKAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:to:from; bh=ddqTeJsKt1TXKMRr+uudUvy9lSDsZ/m7rMiFZnRVmTo=; b=LMPu4cgSZDZDRekGUpRCt78tmbsoejCzOnAFBlx9bXhA7i5FLxwJf685aGBm85BJgO Gz9bg3OYiuTtsPuabtKbUuhQMYb2VdqAZDmRl8rMUmeC22+N4sr2VpSVnx/s6y/ziV1k TFBV8iBr0WXa8SeOIhHqt+ZXvolmS4FIDsiaYseUTf9uBlBzdAxZfmvWJLOx696xb0wd MMkktUmNh59+KxKqlCcQ7v1J8OwcG9+ZqCHBucLzIh7lVq2dY+X6qZSyLLU50p3NckNu HjFUW/8TGk+LddH97imXSSctmyoH/o1Y601U+ojVMygA37bRwrbNqzSdv1qIbpPORghs mGEQ== 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 v24si4171197pgn.64.2019.08.30.02.27.56; Fri, 30 Aug 2019 02:28:12 -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 S1728556AbfH3J0k (ORCPT + 99 others); Fri, 30 Aug 2019 05:26:40 -0400 Received: from mx2.suse.de ([195.135.220.15]:41806 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728213AbfH3JZ6 (ORCPT ); Fri, 30 Aug 2019 05:25:58 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 66F3CAFBB; Fri, 30 Aug 2019 09:25:57 +0000 (UTC) From: Thomas Bogendoerfer To: Ralf Baechle , Paul Burton , James Hogan , "David S. Miller" , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v3 net-next 12/15] net: sgi: ioc3-eth: use csum_fold Date: Fri, 30 Aug 2019 11:25:35 +0200 Message-Id: <20190830092539.24550-13-tbogendoerfer@suse.de> X-Mailer: git-send-email 2.13.7 In-Reply-To: <20190830092539.24550-1-tbogendoerfer@suse.de> References: <20190830092539.24550-1-tbogendoerfer@suse.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org replace open coded checksum folding by csum_fold. Signed-off-by: Thomas Bogendoerfer --- drivers/net/ethernet/sgi/ioc3-eth.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/net/ethernet/sgi/ioc3-eth.c b/drivers/net/ethernet/sgi/ioc3-eth.c index ed8f997a3cec..05f4b598114c 100644 --- a/drivers/net/ethernet/sgi/ioc3-eth.c +++ b/drivers/net/ethernet/sgi/ioc3-eth.c @@ -1391,16 +1391,12 @@ static netdev_tx_t ioc3_start_xmit(struct sk_buff *skb, struct net_device *dev) /* Sum up dest addr, src addr and protocol */ ehsum = eh[0] + eh[1] + eh[2] + eh[3] + eh[4] + eh[5] + eh[6]; - /* Fold ehsum. can't use csum_fold which negates also ... */ - ehsum = (ehsum & 0xffff) + (ehsum >> 16); - ehsum = (ehsum & 0xffff) + (ehsum >> 16); - /* Skip IP header; it's sum is always zero and was * already filled in by ip_output.c */ csum = csum_tcpudp_nofold(ih->saddr, ih->daddr, ih->tot_len - (ih->ihl << 2), - proto, 0xffff ^ ehsum); + proto, csum_fold(ehsum)); csum = (csum & 0xffff) + (csum >> 16); /* Fold again */ csum = (csum & 0xffff) + (csum >> 16); -- 2.13.7