Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1128826ybh; Sat, 14 Mar 2020 18:50:47 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsGyJ7YZu3BtNBYbCtgB9GuDqGUH69RFf0JXq2P8qurHMu3ZdgqkDL53BhI9MYwqPWCdOsV X-Received: by 2002:a9d:53cc:: with SMTP id i12mr17402016oth.11.1584237046882; Sat, 14 Mar 2020 18:50:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584237046; cv=none; d=google.com; s=arc-20160816; b=Bl6oPLvLcx3Qukfw2Njm/hyYwR6c85Ha/cfhtgXQMpafSqN++JPSsTz7dB+osRHbMW +WDHGqMmiJWtG9rB8icCkEr/TDG4CBhyhgKSA1sYB6sX/PYYjBKjLR6CZZkIKqhoXZUV hiVoxcqQfN+sXECloehZN0OLrmf4YiBKWCeDBBPG/qetLuV+JHv3ASv6iO3ZOtHTMkXk zG5fFciTxUKUGws0v5n8/7R1KFCXLioYWI8KsmB+VVi2widyR6wpCj9Qg0IQvRgUQeOl 3c3iy/EFV6r+rXROzR64UoKIAoi4LlnH5MM6alC+n2D6mBMXXlZMd5Y8ZT4m1VWBCz7W jtew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ZqJwLGHtag0Al5GiY7vKr3dHFv5DQyv2vhDvm6i009s=; b=r0KYXJW2LHcxEafMsntSqqXqZd9MZaL4T+P6++JqMtR0c42427ZQS3z3Z2tgpISbWx 6c70Hs5zOU3tRbqJFo4deubQcYcEjtJ2X3jOp2SqoquqvExS6CIwxyHcU+CsGchgiBlY 9XKrIDOomLHn4Hj18JSrzhVt4x+lszZaMMku13yFV68VkWYnpqnd8h9jhaCfkQABdfgs hw5QZ6SPawcTVpHPms3epawExH8rp9he6bMZRoffzOp6FBSoDn9fcDVumQoJO9wc63ZZ S3T3c2LmpcLmdkSvLJ3FVNA25OUiY0UF2+TtS/lf2N/kPKHCjfwTnUYoSsLwd/MDOKzh tGAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=Wd9txCpQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w81si7620234oia.48.2020.03.14.18.50.34; Sat, 14 Mar 2020 18:50:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=Wd9txCpQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727312AbgCOBuE (ORCPT + 99 others); Sat, 14 Mar 2020 21:50:04 -0400 Received: from mout.gmx.net ([212.227.15.19]:32873 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726882AbgCOBuD (ORCPT ); Sat, 14 Mar 2020 21:50:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1584237001; bh=+Cey9W0qDhL9blf7YDqnmxt2qHCMNZyrQN8bBA3CrSY=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=Wd9txCpQI/5g4UWUlwhMVouTlFAPSplltTJTgYiEkgXWWWKWDg3CVQjLH4W2/4dKH j5eIFSEo58SmcaZslrtR2padOrmdrXdi9KjWEhtCDS3AznBH8+7zuvBBq5IaelLeFB xqP0TFxIeCh2grsoufff12Q9Xsf2XMAUFktmTDf0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([83.52.229.196]) by mail.gmx.com (mrgmx004 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MSc1L-1ikOBt21pR-00StSE; Sat, 14 Mar 2020 17:15:20 +0100 From: Oscar Carter To: Greg Kroah-Hartman , Forest Bond Cc: Quentin Deslandes , Malcolm Priestley , Colin Ian King , Gabriela Bittencourt , Oscar Carter , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] staging: vt6656: Use BIT_ULL() macro instead of bit shift operation Date: Sat, 14 Mar 2020 17:14:41 +0100 Message-Id: <20200314161441.4870-1-oscar.carter@gmx.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:dr3jVjQMoh0KUHNN6Az3uPVe0kI6mi8G0B3vSf4x9r+DxqbFhq0 zPDObF/FNVkou6QlsKW4UeWcu3yfV3hwabmhPHwmjWSYt9VjBduGCds+IUfRrheMSO2qlZl h0GRY9v+TbKcccwkpV7OVaeCb2gX6QEg9YSqxdH73FtTHhgDkilyXiO+AMKy0XCgNMS14P6 KQRy1E40L1+4Oq5UykBvw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:3xtwA/ZkCsc=:pgSRMdjVyQ00J1SdbOfXfm EH10/ZUoj7oipiSE6So2KYO92C57N8cNMEtV/3QRty8TDJY8oGRGqcd2ZBX2odlDAE6xHtns7 Ux65fkQsaDAvFUyxRU7HUOro3xutnGJ/LYTg890fGKynFWW9k04ft1Pd2AtmezOMeRcdd1alI yh+Qc+ujDs+UHij+oRmZczR/CylgXlf2+cdnuaq7avgU1oXO6gnOe7jkNRU7hMLJI4NIh44bb r+Qqxd6TL1slQMi+3sHqfNqiGUDptI2nLD/mRPdwoZSXDX6Ke/EekHBkBR9aMbTnwKyn5IVFM kYvcFYSHX/iaf0yxbmW9jxLnJ8iK9MAYNj5QEUgw50mkX8jB+j7JaY98F8YwpuxjzhPne98DN +VOw2juP0tQfDh6psWWG/piwFso+aMFiTsxdJoUJ0a4W2ae3k83lN/4Oo9O1/V6SqAoTNmx6d fICOuGhJtG44BiIB1LM4d7jjMtP7PpE/mHhSJU8pSisX6JTToRBiHGnZ293qXtTSXSflyFuEr wbFTcgc4IyNj637Sgk1SW7TqH0C++15/VxzgqT7byv8WneTnhVLmI8cnnjVqK3DXG9XIuAwL5 XwGMxjpPuPkMU2KvkikE5UqoNlcdKmfnaKKevfFcS12MA0J/GUm3v140AI1u3/jA3epikyqTl uNG5XdpjDdMEwSdf5NDnBHbvKfdyQIWDr+aOVZiqc1EtEkrpvCSRe+B0kuf0Py1Uqs0n0J0Qg 9oEnUTUlIcAL+Rv0MM+g7qpr31/n8k2j/phd9jrJg//dpcR4ESAtX2yyN2bHBnrrGcCLaTeAj rxv9M19OWE6Y4xQTuDLTmk04MZbzN0yiGuy6LBsMxk715wra/wtB8LLaFkztUnQE+WWHPLCro mMccjJy84vRh2yaJLdzJAyBG2VbafQSxJDXQC8yvaqxVNzz1XTr8gnJtxr4Y0mzcAN31WpQhV dk+ZtT1FuJ2k5ncun1H1YZue67zZUyOaLS1v89HBwrU/90Mzh9pftAnvHOAeA90EWJLd/+OeR e6NBNN66TcnhilNHQLUyAGKm1UA+MeakmWlTA6lDqtLga2YfnRVM1zs/ltBfN2Z+nrtmI1A8I nwHBEAU+Pw5SAxDTOWDthRNkx+BJ6uGyTtK1ndyfbZ9CMzXvX0zkUGGHYNk3TMoyS7hL89RKt PP/3lyHRDGYiC2cjrcc1EbRaQWpn2myk2HkFmiQt7Rj0M/Is697P8Vqiv0FF0E+NTarWurOgz s6Y3XjSlr2h7BgPZr Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace the bit left shift operation with the BIT_ULL() macro and remove the unnecessary mask off operation against the bit_nr variable. This mask is only there for legacy reasons. Originally it was 31 (0x1f) and the bit_nr variable spread across an mc_filter array with two u32 elements. Now, this mask is not needed because its value is 0x3f and the mc_filter variable is an u64 type. In this situation, the 26 bit right shift operation against the value returned by the ether_crc function set the bit_nr variable to the following value: bit 31 to bit 6 -> All 0 (due to the bit shift operation happens over an unsigned type). bit 5 to bit 0 -> The 6 msb bits of the value returned by the ether_crc function. The purpose of the 0x3f mask against the bit_nr variable is to reset (set to 0) the 26 msb bits (bit 31 to bit 6), but these bits are yet 0. So, the mask off operation is now unnecessary. Signed-off-by: Oscar Carter =2D-- Changelog v1 -> v2 - Add more information to clarify the patch. - Add notes about the legacy provide by Malcolm Priestley. drivers/staging/vt6656/main_usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/ma= in_usb.c index 5e48b3ddb94c..f7ca9e97594d 100644 =2D-- a/drivers/staging/vt6656/main_usb.c +++ b/drivers/staging/vt6656/main_usb.c @@ -21,6 +21,7 @@ */ #undef __NO_VERSION__ +#include #include #include #include "device.h" @@ -802,8 +803,7 @@ static u64 vnt_prepare_multicast(struct ieee80211_hw *= hw, netdev_hw_addr_list_for_each(ha, mc_list) { bit_nr =3D ether_crc(ETH_ALEN, ha->addr) >> 26; - - mc_filter |=3D 1ULL << (bit_nr & 0x3f); + mc_filter |=3D BIT_ULL(bit_nr); } priv->mc_list_count =3D mc_list->count; =2D- 2.20.1