Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1157931ybt; Sat, 20 Jun 2020 02:40:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwk5o7CVzYXpmn91fRQN03JrxvJjjoh661EwiTzKqFztgeagznb6ED5buFn19JtjQ6dMGE X-Received: by 2002:a17:907:119a:: with SMTP id uz26mr7429787ejb.523.1592646015971; Sat, 20 Jun 2020 02:40:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592646015; cv=none; d=google.com; s=arc-20160816; b=QdWR6EqyB7iujmye6BAlJnRI4P7cwis+iPfYGoIwzPanTPeP8dAOerr2mz5L9YKiAw Er8Tn46kodGuuP6pqzFknvxcwUcjgrLDWFKOg8pBTj+7XIkR7HVChHY8REbxAY3YlqOq 9e5xI1ErluTBhPa35Y7+G/spFNIO3N7jBpwY8//IqrdTBeYZKjyiRALuPmeVdX9OYR3d 9RwMRT3SGS/L13sWr66c3WFZ+h3JDUx+JVoyKDi/JVV8SYL0ZVFPTNB5NQELlt/Lv/qB WBBvLbUI3EeQJb7Z07PdznHdq0fmRMMjb4EN0Rsuym/xB1qlGGnJaj0neGDKwB9BdVtS chNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:reply-to:cc:from:to :dkim-signature:date; bh=ZqCBGivQpOR7bWQOuKEUf/s+T102VDiFA/V/fTLFZqc=; b=R0PQ0EL5jt5HYmTzxhFvvyA344zw3n5uKfJO8TeKcBvBL2huuQVK3ZsQmfzsAzSRti tBXQz3J5lkCFrrP4cX1WQGSBVgy635ihLoVnHhOWA28EYJkrNzDtYy2t7awm/oU4jhXN ZhKtS7nH/vDQ1TTJ2ez4UtC8bd5/oJOpBqIn764p74LvEqv82yi3ktowlYzjvlEigpwX GmI+X2gkywl5HDYOEbNBv6UZzKxThCkKeYrvJ18lZWA6bfhOiOegi05L13y00YsvFhup 1LzirP1wj/CDH/laGolLolXTNXCsMtPDk7mxUgnbMI5p/5GX3XNkTy2fUqmKF+tU8/ha dErQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=DTzrTbxZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dr9si6733513ejc.147.2020.06.20.02.39.53; Sat, 20 Jun 2020 02:40:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@pm.me header.s=protonmail header.b=DTzrTbxZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727909AbgFTJfO (ORCPT + 99 others); Sat, 20 Jun 2020 05:35:14 -0400 Received: from mail2.protonmail.ch ([185.70.40.22]:25135 "EHLO mail2.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727869AbgFTJfN (ORCPT ); Sat, 20 Jun 2020 05:35:13 -0400 Date: Sat, 20 Jun 2020 09:35:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1592645711; bh=ZqCBGivQpOR7bWQOuKEUf/s+T102VDiFA/V/fTLFZqc=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=DTzrTbxZrXttoZLXPKtH8AZoe5YO3WXyoqCLvHbdez2+t565T/Lerh1pRuOpcAicl dN7Z3iUCq8Figxs+3Fy917O08s5P3fzo56FUgsPf5Vn7SM3E0PeK2fVFYQSLTv3z0E mhXIceiqbwYrdsbtgR9BDoExCrJl4OHiV49wH3of+5YrB9ejbIHW75CgL9a3L+HOTQ a/IX+yb7G6/CDg9uyl48vNFxC64jo8/CwI8j2wDOAnPC3af6QWVgACKp7/UFt3X6yq bBeclz7JT1yB5tW59NbaOyXSL2utlZBcC7BZBFJbPq7l/FpmpUxbpTFUoL2lshYJRj IFNKA8M+uYmyg== To: Thomas Bogendoerfer From: Alexander Lobakin Cc: Alexandre Belloni , Paul Burton , Alexander Lobakin , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Reply-To: Alexander Lobakin Subject: [PATCH mips-next 3/3] MIPS: checksum: fix sparse flooding on asm/checksum.h Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=7.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mail.protonmail.ch Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org csum_fold() in MIPS' asm/checksum.h is another source of sparse flooding when building different networking source code. The thing is that only half of __wsum <--> u32 casts inside the funtion is forced, which is insufficient. Add all necessary forced typecasting to stop floods and simplify actual bug hunting. Signed-off-by: Alexander Lobakin --- arch/mips/include/asm/checksum.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/include/asm/checksum.h b/arch/mips/include/asm/check= sum.h index dcebaaf8c862..181f7d14efb9 100644 --- a/arch/mips/include/asm/checksum.h +++ b/arch/mips/include/asm/checksum.h @@ -113,9 +113,9 @@ static inline __sum16 csum_fold(__wsum csum) =09u32 sum =3D (__force u32)csum; =20 =09sum +=3D (sum << 16); -=09csum =3D (sum < csum); +=09csum =3D (__force __wsum)(sum < (__force u32)csum); =09sum >>=3D 16; -=09sum +=3D csum; +=09sum +=3D (__force u32)csum; =20 =09return (__force __sum16)~sum; } --=20 2.27.0