From patchwork Mon Mar 15 01:26:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 12138183 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF905C433DB for ; Mon, 15 Mar 2021 01:29:18 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7EC3D64DAE for ; Mon, 15 Mar 2021 01:29:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7EC3D64DAE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=SOC1rtmjeTtkKX9XJOO0QfJxtmd/lnMGn6wski+Hmeo=; b=HO+SVbPIzmNfo8+FvlrHb0utfD ZOnwIVsockDrso1ahE7Fs7PPd0JDixvYvFy5jDTI0KP1lnYBgCVOD+TNpGEKUESCb2XX6Kwe9ODQK Fdlm46/8b8VZDNVnJJetUZjaLRjgB1LfXl2KD0TJ1gtw9JWQP5G3hu+0tLsLHyXRA7tMt9GcI8cUG EBcq+IKmRNs+6QEkYx2VLjN3RW0hla3cZQyqVIKE+Z13eGt1UQ4QHu41xYQotTw01AOMnv7LXQr6O LtaagbB1eYItfxXoVpfMJ0LDr4cpK0S0hMl9y9LsTVjwsHaFg4i5x3aNyVeRdzXc3joYB/TVzG3CS CX3g9A5w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lLc0Z-00EjUH-Bl; Mon, 15 Mar 2021 01:26:59 +0000 Received: from mail-il1-x131.google.com ([2607:f8b0:4864:20::131]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lLc0V-00EjTu-Jc for linux-arm-kernel@lists.infradead.org; Mon, 15 Mar 2021 01:26:57 +0000 Received: by mail-il1-x131.google.com with SMTP id e7so7886840ile.7 for ; Sun, 14 Mar 2021 18:26:53 -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:mime-version :content-transfer-encoding; bh=IqN1+l9+mYvAuC2nDjrRFzq7WU4KEQGo+hHkda3FvIo=; b=ACVXhZ1bP7NqeT+LDMspwNQhd3ZdhgZW7bNST4BernYUB1i5AAzbuIHDhg6gbNFFXm hiGWzF0LWjrDok+2l7xaJAhZ7nvzCcYZEd5LyQStzpB/XI+B1gBblQ1bf3Z6gvSO5rQv XCEMQboXkSh5zkmfB4Ns8qRCLAXJOK7o8wFKftML92A3+UDI5zHmaJG5VQ64jZF4WcP4 lE/eXbZjuyVUwWP10uCBE/eRAmGBEMQvfBgfSsOZdkl2DW6Iso/k0Jsqa5whyYXlfvxr COTgheXzBPISuaJx/9C3/UcOQv04spspHnzb0U6MIMP/Ixh4JuRvirELwbYOAHXieBU3 RKLg== 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:mime-version :content-transfer-encoding; bh=IqN1+l9+mYvAuC2nDjrRFzq7WU4KEQGo+hHkda3FvIo=; b=WPub4GZ72ohs+XPgnzDBN3pkEaGrSSUdTgqI3nRpg2fmfOB6L9wMB6ZiRFVxGoFeKO xn+k7i+RM3xSHscd7cI4bBWk///OzEpvw0oYkQ5+rkrkf8oAcSvpLeXTVyvWNYZz1auN OQCXJ6Yto2PKIHi+e0ZPF7ncSpiGfB7+YC6poK3pJRpnv8ZKXt3GTbuj8uT9/ImZA+NQ S3ncSSqu/N8iZh9SxhpRxJ4g4Lm38vfaytX+HB9YfKDmLMEckHPZJZaGcCfVl6d32bmZ kL2LS5hU+nZBJbNDPDQMs6ncdrrbR+pnbTjL0W9oEJ1uKh1lS1/5/a6VxBRUwekVGPxL tzhA== X-Gm-Message-State: AOAM533VrgLUPfpZ7rHqejE4opRayaFGZ70mi3NBpZZfO6dzfIAue2Tq 3Bs3ND6J38OL0yJsMdw7wX1ZHw== X-Google-Smtp-Source: ABdhPJwP8LuereZH7kWfB6S7WP/gTSONfsnEfKSep5tfrNuZYbQrTGgZlkacyVl+cnIbkxD1KO8LaQ== X-Received: by 2002:a92:d7c7:: with SMTP id g7mr9698422ilq.305.1615771612870; Sun, 14 Mar 2021 18:26:52 -0700 (PDT) Received: from localhost.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id o13sm6315322iob.17.2021.03.14.18.26.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Mar 2021 18:26:52 -0700 (PDT) From: Alex Elder To: catalin.marinas@arm.com, will@kernel.org, robin.murphy@arm.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] arm64: csum: cast to the proper type Date: Sun, 14 Mar 2021 20:26:50 -0500 Message-Id: <20210315012650.1221328-1-elder@linaro.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210315_012655_905933_6669A9FF X-CRM114-Status: GOOD ( 13.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The last line of ip_fast_csum() calls csum_fold(), forcing the type of the argument passed to be u32. But csum_fold() takes a __wsum argument (which is __u32 __bitwise for arm64). As long as we're forcing the cast, cast it to the right type. Signed-off-by: Alex Elder Acked-by: Robin Murphy --- With this patch in place, quite a few "different base types" sparse warnings go away on a full arm64 kernel build. More specifically: warning: incorrect type in argument 1 (different base types) expected restricted __wsum [usertype] csum got unsigned int [usertype] -Alex arch/arm64/include/asm/checksum.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/checksum.h b/arch/arm64/include/asm/checksum.h index 93a161b3bf3fe..dc52b733675db 100644 --- a/arch/arm64/include/asm/checksum.h +++ b/arch/arm64/include/asm/checksum.h @@ -37,7 +37,7 @@ static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) } while (--n > 0); sum += ((sum >> 32) | (sum << 32)); - return csum_fold((__force u32)(sum >> 32)); + return csum_fold((__force __wsum)(sum >> 32)); } #define ip_fast_csum ip_fast_csum