Received: by 10.223.185.116 with SMTP id b49csp6341470wrg; Wed, 28 Feb 2018 07:52:43 -0800 (PST) X-Google-Smtp-Source: AH8x224Bnl7NvFiRjpGq1y9Wtji1zfhr1pR0VwbpGPqj3YkV9AIPoPBia8VuvgQlbO4mmUlJZuw1 X-Received: by 10.98.217.76 with SMTP id s73mr18081714pfg.209.1519833162932; Wed, 28 Feb 2018 07:52:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519833162; cv=none; d=google.com; s=arc-20160816; b=dVRjsz3JwMEYgByShENJU0TH9tEtz56cKIkW3iEJwWZjciPgM1pOT+0oJgk7xQyHym NP5TjV8Vea1eqBiA9t+j7zrVB+GWm4bKjsoNs1LEP1p6cgoUAXGNywW2Nl+62r67RpLy bjQ+gAkioXAaNZDlWs0MviuinFcsy73drkAfcJNYwd9QAuE7iZY1CwvYYjqa+TPeub/d EEFVSlHc+aHieoSDV09uWwA6cAMX2c2zlDXNWqE3oCUToSXxVONDrEg0QncF2IIKcUKq 46HUgqGIAN9bCFEA7/MPCh4LhFWPM+AJ3fZEaPBib3oiEflVdxeTjwyA39SAW9lYt3qK ZeGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=i8Hat/jn5IuaMcxGvNRQKe2qI4hCZ2MdJGx+/UoJXtM=; b=YWdwOY1OKtCA/WbNf2PezB2uknVgDTF6+56JKOm3bnST418k5VmOaTb4Gkq2q7ZNxW Sa/7CkzF3PmyH+B5M4VdIfm9ScH3zI4fFc5mcKYHyU+GLWZqoSUbp1sB/3hxQrMvqR2T VQsVzNLqLxMlSHa50RAG1U+qis5/cdfy3bM0qt9uoeu88V+o934iqsqWIoiUAnw7XHh4 UhsZfQIvbpEgtCwVYwszrtaH/G9tPOGYQTtEir9Ekzkv4J/Y6/K6lC9zVW5x8O1Nke7I 0AkUYM3GMLeCLdQzaLQEw53Zvr6J4zd2mQ8kB0hrZXjwqzCFcm9Lc4eehQQ/zKX3iYWc ByjQ== 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 f3-v6si1408109plb.717.2018.02.28.07.52.28; Wed, 28 Feb 2018 07:52:42 -0800 (PST) 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 S1752911AbeB1PuT (ORCPT + 99 others); Wed, 28 Feb 2018 10:50:19 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:34313 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752793AbeB1PuQ (ORCPT ); Wed, 28 Feb 2018 10:50:16 -0500 Received: from [2a02:8011:400e:2:6f00:88c8:c921:d332] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1er3Yu-0006Xk-DA; Wed, 28 Feb 2018 15:22:32 +0000 Received: from ben by deadeye with local (Exim 4.90_1) (envelope-from ) id 1er3Yd-0008Od-OV; Wed, 28 Feb 2018 15:22:15 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Xin Long" , "David S. Miller" , "Marcelo Ricardo Leitner" Date: Wed, 28 Feb 2018 15:20:18 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 030/254] sctp: force the params with right types for sctp csum apis In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.55-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Xin Long commit af2697a0273f7665429c47d71ab26f2412af924e upstream. Now sctp_csum_xxx doesn't really match the param types of these common csum apis. As sctp_csum_xxx is defined in sctp/checksum.h, many sparse errors occur when make C=2 not only with M=net/sctp but also with other modules that include this header file. This patch is to force them fit in csum apis with the right types. Fixes: e6d8b64b34aa ("net: sctp: fix and consolidate SCTP checksumming code") Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller Signed-off-by: Ben Hutchings --- include/net/sctp/checksum.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) --- a/include/net/sctp/checksum.h +++ b/include/net/sctp/checksum.h @@ -48,31 +48,32 @@ static inline __wsum sctp_csum_update(co /* This uses the crypto implementation of crc32c, which is either * implemented w/ hardware support or resolves to __crc32c_le(). */ - return crc32c(sum, buff, len); + return (__force __wsum)crc32c((__force __u32)sum, buff, len); } static inline __wsum sctp_csum_combine(__wsum csum, __wsum csum2, int offset, int len) { - return __crc32c_le_combine(csum, csum2, len); + return (__force __wsum)__crc32c_le_combine((__force __u32)csum, + (__force __u32)csum2, len); } static inline __le32 sctp_compute_cksum(const struct sk_buff *skb, unsigned int offset) { struct sctphdr *sh = sctp_hdr(skb); - __le32 ret, old = sh->checksum; const struct skb_checksum_ops ops = { .update = sctp_csum_update, .combine = sctp_csum_combine, }; + __le32 old = sh->checksum; + __wsum new; sh->checksum = 0; - ret = cpu_to_le32(~__skb_checksum(skb, offset, skb->len - offset, - ~(__u32)0, &ops)); + new = ~__skb_checksum(skb, offset, skb->len - offset, ~(__wsum)0, &ops); sh->checksum = old; - return ret; + return cpu_to_le32((__force __u32)new); } #endif /* __sctp_checksum_h__ */