Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1806759pxb; Fri, 20 Aug 2021 14:43:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBcKJHkjTTRm/WIXB1cHKsejTtTcWv564pgZLRRdesNu+kJvFKwr54yNNbzEriMPmi0sOQ X-Received: by 2002:a17:906:1d43:: with SMTP id o3mr23925388ejh.44.1629495799214; Fri, 20 Aug 2021 14:43:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629495799; cv=none; d=google.com; s=arc-20160816; b=acXyT7vojA4SoSJhzXl0PjlNU16Kp5xQizyTIHCSrsevFtL609jq8X8h092WjeMr9N a2HazSfDRhEyU6C5NTghRNfWHgoJNLj8mkfQ6sMAfoIadhN98Bi0qa6IUj+8CGT2nIFF w/vLO70G+7zVb6gffWL0D1UuHM9dONSTzTr311/DmN7e5edvj4Yq9Ndks284alIUZIDt SzH+1ZieMb7Rj2/gPwCSsszbHQX5YWOE84FN4xb+ezz3c0fUOFr0ECgjLSEeexcUJOrR yS4FtlF1qgLaud6u4127RRJwy5w4ZAjZmwy137JnshjQKSOPsaz9vvNF4HmbErF5Pccw N+BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:sender:dkim-signature; bh=N7XPfZrpLOPQ3NWuP/cwpVYxz6UbQiCYNHlikEjuLok=; b=VAorc0e00kzQH7c//wReOvxuUFLX78RMf0xerv1toyK9PTIq9KgcVUJgT4UxaPsZJt 1E1PBwtwcPncObj5fF6ZTEXKCw0Gig+WwnHN+QmI78umvDa6UQBBPUjiYihyQyhdCaq8 5p+O/M+R3Usv5WSShg6GXg3/fiJQDBYG/0s8pKBMFkRT2m9VeRl8jQ7hfIit+Bd5BmfR v0flgntzbsWIu0Z9yJiPZw0HPJHxXSPiBAd7+ilxEO4PGNuON/MIfXHP/xLTW4Ne+Ldy l2gh1bgDaQjulbfCmqe6oKIwr+1jgSaMpCQ66JbnE2DInScGVHArQboIBy93Tn6ofLqJ EvpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aWIMoTVo; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id du15si7641123ejc.498.2021.08.20.14.42.29; Fri, 20 Aug 2021 14:43:19 -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=@gmail.com header.s=20161025 header.b=aWIMoTVo; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231322AbhHTVio (ORCPT + 99 others); Fri, 20 Aug 2021 17:38:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229760AbhHTVin (ORCPT ); Fri, 20 Aug 2021 17:38:43 -0400 Received: from mail-ot1-x32f.google.com (mail-ot1-x32f.google.com [IPv6:2607:f8b0:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64200C061575 for ; Fri, 20 Aug 2021 14:38:05 -0700 (PDT) Received: by mail-ot1-x32f.google.com with SMTP id y14-20020a0568302a0e00b0051acbdb2869so10365495otu.2 for ; Fri, 20 Aug 2021 14:38:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=N7XPfZrpLOPQ3NWuP/cwpVYxz6UbQiCYNHlikEjuLok=; b=aWIMoTVoWZNs3yRDn8pUNWaxKg7XQsvdmhbRj3EmZJPwSb6AlzJfB2UNPGfbahts95 wkTIbGsPD2D8SxBmn08rbtOTq+m4IM+U3cihi57neg+8i310yjAsdz9iwKE5NANCYtIW H2B+3fnEeHnjyEZoQgnahSS7QsGSWWg8C7XkRVGUX8QbSUpDeC3d8iwfidVuem6bayU2 FWQiVc+Ak8vfgrdHIeuQG5Py8MtaCCiVXkzTJrsi5kkiShh7oNK3Qe7SuEQLTvvmZ19p 05CiZAcuscEZ1BDS89S7XC/XP96IhQyVw+0WClUpxl+FjfmK2B6PuQFtKyr4qRJLlAoM WH5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=N7XPfZrpLOPQ3NWuP/cwpVYxz6UbQiCYNHlikEjuLok=; b=Rx6L92qW+BjxgKwA+QbkYndWBRIcXnpZHhfHgk8aeRlKPOx9CX8encLq5v+u8lVHX7 4NRkMD27byJYPAcjgOFDvzDnltDtV7xbdTbGE/Ydsw8wxD6LDtzFYUCiE74e0ZgOskOc vPhVwsTzwNF19R/FCYMvzpck7kN8f58FE/RvqTPMt672eaDzVGSMsa9aBMKB+JRSkG5q oph6WLymP99gdjvdrLC95GdQ7emvBQ6gs3ybjaHnpAZ5A5c91JEydu3hwiuKOCMIobD1 EZY8AMS2w/aFmlEeePCl6vYx3ouPlJ6FQYQ/4FP2xJ/NKHZVpUslazkSJ8nfso+himmJ BVjg== X-Gm-Message-State: AOAM530dr0VUrOiWq+1lBNzoEu3WDpK0LrcniHfw+m45RgHiwAMN5Obo ctV7HnDNYV1NofDEsUoGL49+3d8VK10= X-Received: by 2002:a05:6808:690:: with SMTP id k16mr4514518oig.152.1629495484559; Fri, 20 Aug 2021 14:38:04 -0700 (PDT) Received: from 2603-8090-2005-39b3-0000-0000-0000-1023.res6.spectrum.com (2603-8090-2005-39b3-0000-0000-0000-1023.res6.spectrum.com. [2603:8090:2005:39b3::1023]) by smtp.gmail.com with ESMTPSA id f33sm1761642otf.0.2021.08.20.14.38.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Aug 2021 14:38:03 -0700 (PDT) Sender: Larry Finger Subject: Re: [PATCH v2 3/5] staging: r8188eu: incorrect type in csum_ipv6_magic To: Aakash Hemadri , Greg Kroah-Hartman , Phillip Potter Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org References: <8bc15e51751c26fd19428f3b4976b7495feecd34.1629360917.git.aakashhemadri123@gmail.com> From: Larry Finger Message-ID: <58069e38-a457-9fcc-0a9a-6bfe8723a178@lwfinger.net> Date: Fri, 20 Aug 2021 16:38:02 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <8bc15e51751c26fd19428f3b4976b7495feecd34.1629360917.git.aakashhemadri123@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/19/21 3:17 AM, Aakash Hemadri wrote: > Fix sparse warning: >> rtw_br_ext.c:771:84: got restricted __be16 [usertype] payload_len >> rtw_br_ext.c:773:110: warning: incorrect type in argument 2 > (different base types) >> rtw_br_ext.c:773:110: expected int len >> rtw_br_ext.c:773:110: got restricted __be16 [usertype] payload_len > > csum_ipv6_magic and csum_partial expect int len not __be16, use ntohs() > > Signed-off-by: Aakash Hemadri > --- > drivers/staging/r8188eu/core/rtw_br_ext.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c > index 6a0462ce6230..d4acf02ca64f 100644 > --- a/drivers/staging/r8188eu/core/rtw_br_ext.c > +++ b/drivers/staging/r8188eu/core/rtw_br_ext.c > @@ -615,9 +615,9 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) > struct icmp6hdr *hdr = (struct icmp6hdr *)(skb->data + ETH_HLEN + sizeof(*iph)); > hdr->icmp6_cksum = 0; > hdr->icmp6_cksum = csum_ipv6_magic(&iph->saddr, &iph->daddr, > - iph->payload_len, > + ntohs(iph->payload_len), > IPPROTO_ICMPV6, > - csum_partial((__u8 *)hdr, iph->payload_len, 0)); > + csum_partial((__u8 *)hdr, ntohs(iph->payload_len), 0)); > } > } > } > This patch is correct, but I prefer that you use be16_to_cpu() rather than ntohs(). I think it makes the code easier to read. Larry