From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B71072 for ; Thu, 2 Sep 2021 09:25:56 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 201AB61058; Thu, 2 Sep 2021 09:25:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1630574755; bh=Yxy8KM/Ohu/+iS5kBagZcmeiZaFKnSW9/TTj7inv4ZU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fhaf3pWmgUnA6/2gPoyol3nOWFW9Zx2baVX1bw7KONGrfY5le3/P3g2TbzqVF9bFU jxWQZZ83QxQ0lyK0EeZndMYhLnRl9FOzYvm5Zw1tvLlbdVCFkoh7FDKOqmGktH4xXB x//lyqtDFvQp/2+4OZ7W0Lje4pW5X9z33xDNvoLY= Date: Thu, 2 Sep 2021 11:25:53 +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 1/3] staging: r8188eu: restricted __be16 degrades to int Message-ID: References: <652e62b7f30d216bafc6ef390ed27c2c6864fe95.1630148641.git.aakashhemadri123@gmail.com> Precedence: bulk X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <652e62b7f30d216bafc6ef390ed27c2c6864fe95.1630148641.git.aakashhemadri123@gmail.com> On Sat, Aug 28, 2021 at 04:40:44PM +0530, Aakash Hemadri wrote: > Fix sparse warning: > > rtw_br_ext.c:73:23: warning: restricted __be16 degrades to integer > > Here tag->tag_len is be16, use be16_to_cpu() > > Signed-off-by: Aakash Hemadri > --- > drivers/staging/r8188eu/core/rtw_br_ext.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c > index 62a672243696..aa56cd1a8490 100644 > --- a/drivers/staging/r8188eu/core/rtw_br_ext.c > +++ b/drivers/staging/r8188eu/core/rtw_br_ext.c > @@ -70,7 +70,7 @@ static int __nat25_add_pppoe_tag(struct sk_buff *skb, struct pppoe_tag *tag) > struct pppoe_hdr *ph = (struct pppoe_hdr *)(skb->data + ETH_HLEN); > int data_len; > > - data_len = tag->tag_len + TAG_HDR_LEN; > + data_len = be16_to_cpu(tag->tag_len) + TAG_HDR_LEN; > if (skb_tailroom(skb) < data_len) { > _DEBUG_ERR("skb_tailroom() failed in add SID tag!\n"); > return -1; > -- > 2.32.0 > If this change happens, that means the existing driver does not work at all on little-endian machines today? But that seems odd and wrong, are you sure this change is correct? How did you test this? thanks, greg k-h