Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp910426ybl; Wed, 28 Aug 2019 07:06:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyvUTAoJ0Eyc2Q3Nf4T3G/4Cc+eOXV5O/thcEBsI9/02lwlm3+tbaOSCwooZUiFKQqf6TRQ X-Received: by 2002:a62:f204:: with SMTP id m4mr5019317pfh.7.1567001189646; Wed, 28 Aug 2019 07:06:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567001189; cv=none; d=google.com; s=arc-20160816; b=ue8mGON8VSTf4zSOm1flr6P0Nn3yguiBw4Uni+ucdHX0YtWkxycp/Ume37UES9BMBh h5W7toTttawgaTawkrfRBmvwGHNBPb3bUzy8kNpOW9vVm+h1fYdrs9HRgudq2kxonRRs n9Z796R7G7uK8TeT+JA68Vyk33PZECMy8YNF/VUODomxcYeU3zvuYyBxMFoDpVNde9/k sqxRFvQemVkddyhIaTxZVEP+8EPNmyh55ZyMgJU1fTKN+cIad7zCuLL9KgH3797MIegm U79hON8XgX1JAmxOmk88vJXY624AP7yM+m9jPA97RKHcy6qgw35jZYIwVeR1TZQ7cqvC Ew7g== 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=2+A4kFuBq46WAZq8hAMbTx5JXSS7UGxDj2bKWydXSKM=; b=xUsuXremkC0dS9fcAjYWUB8dHwfkKab4Ep5olSLJBrX/Qf90W4cVR9fn8nHoGfFSI+ RS8lvYe4Gu/LIp5JVpRC3TfJXuo+CM9oiKXUdOxEWxS6x/HZ/TyrO1IgpVpZ0uBhmbHG 845+Suo2YNH/tHRAlP8K9+9X3N1Tih2BpT8e2pBLMMel9Ydd+vpsT9AAwQo2dgJ4WwNW 1eUt9CDB9fhAQkJdWinCZjdRuPcLEkZB4KW2ow6OA3opv1tAzZ3BhZgvVOM/IcQfO00p XYzBNuxedhgO14l1sDx9LZtOSqemg00Cx/vWFcrCtAKQZatnmWVTrU7oPT4zNp9sBaeF YX3A== 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 n22si1876526pjt.55.2019.08.28.07.06.11; Wed, 28 Aug 2019 07:06:29 -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 S1726457AbfH1OEL (ORCPT + 99 others); Wed, 28 Aug 2019 10:04:11 -0400 Received: from mx2.suse.de ([195.135.220.15]:39766 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726844AbfH1ODd (ORCPT ); Wed, 28 Aug 2019 10:03:33 -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 8D352B653; Wed, 28 Aug 2019 14:03:32 +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 net-next 12/15] net: sgi: ioc3-eth: use csum_fold Date: Wed, 28 Aug 2019 16:03:11 +0200 Message-Id: <20190828140315.17048-13-tbogendoerfer@suse.de> X-Mailer: git-send-email 2.13.7 In-Reply-To: <20190828140315.17048-1-tbogendoerfer@suse.de> References: <20190828140315.17048-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 aea3fecfac24..82a298eea8d4 100644 --- a/drivers/net/ethernet/sgi/ioc3-eth.c +++ b/drivers/net/ethernet/sgi/ioc3-eth.c @@ -1393,16 +1393,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