Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2936302ybl; Mon, 19 Aug 2019 09:34:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqyGrR8pCkLSWCOf8pa4nAJRP4T1JjDy2/0YrL5IKeAuH6ukz5YFD4j5EwBCiUu5FaNhSsrR X-Received: by 2002:aa7:842f:: with SMTP id q15mr24912822pfn.250.1566232467465; Mon, 19 Aug 2019 09:34:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566232467; cv=none; d=google.com; s=arc-20160816; b=MQzFjQd/pwJ//bQCl+G02Uwq9+Dhm0reSzQaTlIzZaTV9Mf3JSvNXI6jitp17pdIGW iMCIohOIcRWrWjQIf88h9pGaXUTp3rXIx8l5nUBkXqv8dohcDrvdrc/nJE0KMJUa3Ri5 kwhWzxEXu1d3hHYKfhH5jZLOpRsqxboSN7tO9Bs0yKu7sxb38E6FrkrIoDBtakZuxVUa qqAWvwjq5vG6vc4ao2YZJ9Bj2EiuPWrS5b385/p8EcGYYH6rIiJ+091LzvhzPLnCwo8j Iqnyaov+G5Po47kY9qyxSwbJCbRb9GFrmITRCo8XzE2Z8EhqCq3DH9zLA3XbUEF9Zscp SBpg== 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=wuC6pIvItE+Ro3ZHZ3Nyrd0FqIsXv10fs8Kpb3JHFb4=; b=M5U1GRQuFfwFPhf+yVDulWlz6EVHRb1eCD34jp4e+8ERsgXZhxi9vMw8FPByZYyqUr XgwtwbGmMjBMPICw0JYUzojYIZylbt0n/oRo6LhKCO+XtjspPEA0NpO2v/hZ+DKIwez6 02sT4pudaXAtYYlNYSPA7mt/BikAJJwNhJVAVMMNVe3tuHrnID2G3Y6ZwjM63UJE4/AZ R2DFv/DWDmnj/mPmiraf70BN9Lj8GFK7Bv+dSqvgCKm8EKPVAo1L71JpGLeHjchnurQk gX0FwapR6T6NwDzBGaFE+FJzTuF1CnJhn5/ON9GxfQQbH5I8gr16k17+RtdmFl1sglvK KMnA== 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 y193si10063420pgd.108.2019.08.19.09.34.11; Mon, 19 Aug 2019 09:34:27 -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 S1728214AbfHSQcy (ORCPT + 99 others); Mon, 19 Aug 2019 12:32:54 -0400 Received: from mx2.suse.de ([195.135.220.15]:55590 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727994AbfHSQcI (ORCPT ); Mon, 19 Aug 2019 12:32:08 -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 532A6B628; Mon, 19 Aug 2019 16:32:05 +0000 (UTC) From: Thomas Bogendoerfer To: Jonathan Corbet , Ralf Baechle , Paul Burton , James Hogan , Dmitry Torokhov , Lee Jones , "David S. Miller" , Srinivas Kandagatla , Alessandro Zummo , Alexandre Belloni , Greg Kroah-Hartman , Jiri Slaby , Evgeniy Polyakov , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-input@vger.kernel.org, netdev@vger.kernel.org, linux-rtc@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH v5 13/17] net: sgi: ioc3-eth: use csum_fold Date: Mon, 19 Aug 2019 18:31:36 +0200 Message-Id: <20190819163144.3478-14-tbogendoerfer@suse.de> X-Mailer: git-send-email 2.13.7 In-Reply-To: <20190819163144.3478-1-tbogendoerfer@suse.de> References: <20190819163144.3478-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 647e3926bd71..56392f0b01de 100644 --- a/drivers/net/ethernet/sgi/ioc3-eth.c +++ b/drivers/net/ethernet/sgi/ioc3-eth.c @@ -1378,16 +1378,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