Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp290917pxb; Wed, 25 Aug 2021 03:26:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDsMtYNRPb5lQwzILIZRjXf9ACfJLiFVIgmjGoXBETGnwXtW6wuglgY4r0ewrQ9EECKUby X-Received: by 2002:a17:906:69d0:: with SMTP id g16mr44780292ejs.20.1629887202773; Wed, 25 Aug 2021 03:26:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629887202; cv=none; d=google.com; s=arc-20160816; b=BJAcFQ9I/tiHCwl5ygzTlqogarnaJfxXGfh2k7OaKQl7zOlEGTWN38MM5zzRUdll+R 8q7ynCK6tUhJOn+nChWeRF2SJrtrDGyTyzz2YSnlJCW4NeL8OJ5lkTfUAjuMIVwblfKY 4BH4tBNQQFh6840hhunfDVOCr5CpnHqw2p5zYiRYqgHGoSGodTVJuvLJW6VzbT/S1wh2 ETqN7s7/H9qNCUjIzQuWeIW6USpgpZoBTRHeJGgxMfY/m5eMMKWK8/OX+j177atBxmfl Ye0GcsK56hzX5znTu9XOF5Fh08IGCn6w1q8Q38NYtGO8KnsOXBGRtKDzoJgZ89NwOO2b NuRg== 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 :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=9omFxqwxtcwBe1kWgOVqogHoJGFFdk7gWhand7MSDJQ=; b=Wr3dBOU259gH2HUHJJ2ecF/NGBRV1eC/WNkGKDHDc8BF2BVfPXiJvUvLcoyj0G/VVv dn8rOwQmxXpxagec7e1rLMh1YHo1+D0u1FKFGjQDWqE8D50ciyd9BKhmTc/VYL/ki9xw A4U1GUKmfvmPoBDDtfhj5r2Y4GOQq44sN4BUHuZWf/bXNmlsNyDirvcb8hbU0mq0jeR4 ALa0TokdP8Xqcmd8ZjqnlmGmGGg7Egn1MBPV0dUZ+qUZQXU/jHAZYgBPkuJRvkQgRGhv 51pYCw/KbxiPlpjqatu1gSsl2hOlWbl+zyPo7TKps+lZ4XA8Nu3X3uJzMeGxCCCAS5am KaQg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z19si22472588edq.65.2021.08.25.03.26.10; Wed, 25 Aug 2021 03:26:42 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239054AbhHYKWW convert rfc822-to-8bit (ORCPT + 99 others); Wed, 25 Aug 2021 06:22:22 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.85.151]:56258 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237516AbhHYKWR (ORCPT ); Wed, 25 Aug 2021 06:22:17 -0400 Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-68-2GvGDmlwPsiQ0AnOLMju9A-1; Wed, 25 Aug 2021 11:21:25 +0100 X-MC-Unique: 2GvGDmlwPsiQ0AnOLMju9A-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Wed, 25 Aug 2021 11:21:23 +0100 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.023; Wed, 25 Aug 2021 11:21:23 +0100 From: David Laight To: 'Dan Carpenter' CC: 'Larry Finger' , Aakash Hemadri , Greg Kroah-Hartman , Phillip Potter , "linux-staging@lists.linux.dev" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH v3 2/5] staging: r8188eu: cast to restricted __be32 Thread-Topic: [PATCH v3 2/5] staging: r8188eu: cast to restricted __be32 Thread-Index: AQHXmCqSnSVpiVCtaEyxz8Go65B0FauD8RPg///yZ4CAACGg0A== Date: Wed, 25 Aug 2021 10:21:23 +0000 Message-ID: References: <50439a81aca7ce8c3c97ec1c7247f4cd03f645a5.1629562355.git.aakashhemadri123@gmail.com> <20210823084426.yo2mhgbyehkwwz3h@xps.yggdrasil> <25d336b5-8008-9b3b-7efe-a82afaea0e98@lwfinger.net> <20210825091921.GR1931@kadam> In-Reply-To: <20210825091921.GR1931@kadam> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter > Sent: 25 August 2021 10:19 > > On Wed, Aug 25, 2021 at 09:13:44AM +0000, David Laight wrote: > > From: Larry Finger > > > Sent: 23 August 2021 15:24 > > > > > > On 8/23/21 3:44 AM, Aakash Hemadri wrote: > > > > On 21/08/21 09:48PM, Aakash Hemadri wrote: > > > >> Fix sparse warning: > > > >>> rtw_br_ext.c:836:54: warning: cast to restricted __be32 > > > >> > > > >> dhpch->cookie is be32, change it's type. > > ... > > > >> diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c > b/drivers/staging/r8188eu/core/rtw_br_ext.c > > > >> index f6d1f6029ec3..f65d94bfa286 100644 > > > >> --- a/drivers/staging/r8188eu/core/rtw_br_ext.c > > > >> +++ b/drivers/staging/r8188eu/core/rtw_br_ext.c > > ... > > > >> @@ -671,7 +671,7 @@ void dhcp_flag_bcast(struct adapter *priv, struct sk_buff *skb) > > > >> (udph->dest == __constant_htons(SERVER_PORT))) { /* DHCP request */ > > > >> struct dhcpMessage *dhcph = > > > >> (struct dhcpMessage *)((size_t)udph + sizeof(struct > udphdr)); > > > > This assignment looks dubious at best - WTF is (size_t) for? > > I don't seem to have a source tree with this driver in it (probably only in 'next'?). > > I suspect it should be: > > struct dhcp_message *dhcph = (void *)(udph + 1); > > Those are equivalent. Either way works. size_t isn't guaranteed to be large enough to hold a pointer. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)