Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp214516pxb; Thu, 2 Sep 2021 02:28:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDXcdaGOGU85uvZlnYIyDogRKNd8bMgrLnEOrO+/KgDOPQIX+ZJ9V8zQP/RYIY9u1O1Egn X-Received: by 2002:a92:c60d:: with SMTP id p13mr1653353ilm.8.1630574912680; Thu, 02 Sep 2021 02:28:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630574912; cv=none; d=google.com; s=arc-20160816; b=a+Z3PtLiGD3z266xJYAQBSTGe7GNIll3nr+IMybd54Jh/tH21BTCbBYnc7n/uoHRtK yp9sXfUQtGFZo45oU653PosIUpKE/wU28o2dBGNl7cBiogJsFltLJ368tYbs+xwGBK9c bOOYL6I/43fx0F+1YAIAPWu31jXVubZPi+fsnNkkI1MvatpVxvBr5Jc9Ijy/crD66e8m 3jDJfkGQbZIUl+1PjdtyRgJ2MHVwUqfkMiQCMty+WVPz+eAoLKOBaFriVyPDMVrDn6FE UFEGr7Vx3UXYunFkwOWLnx98D/YptYSBC2HALHxkd0jGsByLbLHsiC1+pS5e8oxkF+FC 5Q1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Wt8ULOZCjM/OGQsDx9OkoDM3ydz8WFToJnH6GQFmSpw=; b=omotj89FKJ9aF3sKCNJZfPP8VU/+0WoA4RXrTtkL6j7GzxhCWATXHwwyPR3pe/93Nm 7sVg5GqWoZKAwiMVmB1lRDi/FcHibRQ66F2uu+7wR/OPNeqfOZ6PzQfqB9wRL7j1PYTf e1Bk2NDEK3Z0+sGo82yBIpdCYMCe7d8CV9Kgf3E/dtTM/gka4prHwm/VMLx8bob0prpj 2iKTqrpNdwEHCmwaCXUB2B18ioQIfCd5Am2w7RD6HU8oiN96JxNXYGHMGQBm4RHNI/VH 9JRh30qafqR6qct5bGj8zGl8rj54VRegzQ37Uvu+nHUfPQtIvE5lNXxN/4sfdyplReGa /ORA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rEKzGXZw; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u11si1867998jau.60.2021.09.02.02.28.20; Thu, 02 Sep 2021 02:28:32 -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=@linuxfoundation.org header.s=korg header.b=rEKzGXZw; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245536AbhIBJ2Q (ORCPT + 99 others); Thu, 2 Sep 2021 05:28:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:50210 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245139AbhIBJ2P (ORCPT ); Thu, 2 Sep 2021 05:28:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3763661058; Thu, 2 Sep 2021 09:27:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1630574837; bh=82jAsd5ucM4y4MfsjWEHLTMjJeY6MKU7mDhIATERYzk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rEKzGXZwed3XPdNAWIPWXqC5ejyCuopnYb1hCpYo979o9HHDgV56+TJ5iDQZe56t6 OO2nptiFU3LQjnyUTzdzfVmOqz1ptMHVm5h/LQaQH99U1w2dNGZUPWdWiKVrhfFRKF yzkeMXoMAmL6FrQf0f8sYKZj0dSSi/okAgx4o22A= Date: Thu, 2 Sep 2021 11:27:15 +0200 From: Greg Kroah-Hartman To: Aakash Hemadri Cc: Larry Finger , Phillip Potter , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 2/3] staging: r8188eu: incorrect type in csum_ipv6_magic Message-ID: References: <0b7d6e92c79a6daf55a0c3a4961df6f33a9bcf37.1630148641.git.aakashhemadri123@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0b7d6e92c79a6daf55a0c3a4961df6f33a9bcf37.1630148641.git.aakashhemadri123@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 28, 2021 at 04:40:45PM +0530, 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 > be16_to_cpu() > > 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 aa56cd1a8490..38f1bd591da9 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, > + be16_to_cpu(iph->payload_len), > IPPROTO_ICMPV6, > - csum_partial((__u8 *)hdr, iph->payload_len, 0)); > + csum_partial((__u8 *)hdr, be16_to_cpu(iph->payload_len), 0)); > } > } > } > -- > 2.32.0 > Same question here, does this mean the driver is broken on little-endian systems today? This should be tested... thanks, greg k-h