From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD41BC61DA4 for ; Mon, 30 Jan 2023 16:32:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236648AbjA3Qcg (ORCPT ); Mon, 30 Jan 2023 11:32:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237278AbjA3Qcc (ORCPT ); Mon, 30 Jan 2023 11:32:32 -0500 Received: from proxima.lasnet.de (proxima.lasnet.de [IPv6:2a01:4f8:121:31eb:3::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADD4E39CC6; Mon, 30 Jan 2023 08:32:29 -0800 (PST) Received: from [192.168.2.51] (p4fc2fe3a.dip0.t-ipconnect.de [79.194.254.58]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: stefan@datenfreihafen.org) by proxima.lasnet.de (Postfix) with ESMTPSA id 409CCC0072; Mon, 30 Jan 2023 17:32:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datenfreihafen.org; s=2021; t=1675096345; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sOkv+PIqJ2IbV0QjFFTw1jbSQtCSFXVODQir2FyS2MQ=; b=Xy9x4Poa/IcjAKijj+yE7r7cIvDZXu5yVyNgh02DujCRxUInZxGU4Bj4Fo3dbhS+Xv9hFj aj6PQf0rcmtTmo/CZNmZCRa4EO2VGscvssV8v3tBOkWzIG5Usg7yVUS+FNi6BTNGHqev9o uBVsT0z5s0g5YCkfDLaDN0mHbYfRMRSWbhfgwdOmUCYw7dcPs3MGVjY875OcI0h4PsofIn LI1shFQvbYOa+v8al82s8fXJDVGFyOhjr/FtQenc0qyBX+EbeUwFPoZMhZdv5Jf5Cx8rYp KazJ19aMTRTkdJ7nUlDFl1IJnDGurBYJlhb6ebcmnIv+pvg/ZCkwsoQxOvKlsA== Message-ID: Date: Mon, 30 Jan 2023 17:32:24 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH wpan-next] mac802154: Avoid superfluous endianness handling Content-Language: en-US To: Miquel Raynal , Alexander Aring , linux-wpan@vger.kernel.org Cc: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet , netdev@vger.kernel.org, David Girault , Romuald Despres , Frederic Blain , Nicolas Schodet , Guilhem Imberton , Thomas Petazzoni , kernel test robot References: <20230130154306.114265-1-miquel.raynal@bootlin.com> From: Stefan Schmidt In-Reply-To: <20230130154306.114265-1-miquel.raynal@bootlin.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hello. On 30.01.23 16:43, Miquel Raynal wrote: > When compiling scan.c with C=1, Sparse complains with: > > sparse: expected unsigned short [usertype] val > sparse: got restricted __le16 [usertype] pan_id > sparse: sparse: cast from restricted __le16 > > sparse: expected unsigned long long [usertype] val > sparse: got restricted __le64 [usertype] extended_addr > sparse: sparse: cast from restricted __le64 > > The tool is right, both pan_id and extended_addr already are rightfully > defined as being __le16 and __le64 on both sides of the operations and > do not require extra endianness handling. > > Fixes: 3accf4762734 ("mac802154: Handle basic beaconing") > Reported-by: kernel test robot > Signed-off-by: Miquel Raynal > --- > net/mac802154/scan.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/net/mac802154/scan.c b/net/mac802154/scan.c > index cfbe20b1ec5e..8f98efec7753 100644 > --- a/net/mac802154/scan.c > +++ b/net/mac802154/scan.c > @@ -419,8 +419,8 @@ int mac802154_send_beacons_locked(struct ieee802154_sub_if_data *sdata, > local->beacon.mhr.fc.source_addr_mode = IEEE802154_EXTENDED_ADDRESSING; > atomic_set(&request->wpan_dev->bsn, -1); > local->beacon.mhr.source.mode = IEEE802154_ADDR_LONG; > - local->beacon.mhr.source.pan_id = cpu_to_le16(request->wpan_dev->pan_id); > - local->beacon.mhr.source.extended_addr = cpu_to_le64(request->wpan_dev->extended_addr); > + local->beacon.mhr.source.pan_id = request->wpan_dev->pan_id; > + local->beacon.mhr.source.extended_addr = request->wpan_dev->extended_addr; > local->beacon.mac_pl.beacon_order = request->interval; > local->beacon.mac_pl.superframe_order = request->interval; > local->beacon.mac_pl.final_cap_slot = 0xf; This patch has been applied to the wpan-next tree and will be part of the next pull request to net-next. Thanks! regards Stefan Schmidt