From patchwork Sun Jun 17 10:07:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omer Efrat X-Patchwork-Id: 10468747 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 80BED600CC for ; Sun, 17 Jun 2018 10:07:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 640982881E for ; Sun, 17 Jun 2018 10:07:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 58707288CF; Sun, 17 Jun 2018 10:07:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE1A12881E for ; Sun, 17 Jun 2018 10:07:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933499AbeFQKHo (ORCPT ); Sun, 17 Jun 2018 06:07:44 -0400 Received: from mail-he1eur01on0115.outbound.protection.outlook.com ([104.47.0.115]:21146 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933278AbeFQKHn (ORCPT ); Sun, 17 Jun 2018 06:07:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tandemg.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zF56PZNOVyGQ7tm9l7MZYhIRQuzpOzwlsVvbTmZdlZ8=; b=fs3h2TS+928cv+C6Z+5Q4O2+Bn6L7V6hIxHFnMZQlFU6mIFBoV6Kr85vDFH97iBF63dQVwL6oRks+bSCIyMzuArDPCrP8zuNYffdLqLOL6zSn9mu3srK6ahU589590IAQBUrhn8j0vbm9CJvx3DAueQC0RzqHyUO7rb+pW7fxNA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=omer.efrat@tandemg.com; Received: from omer-laptop.tandemg.local (37.142.120.98) by AM6PR02MB3621.eurprd02.prod.outlook.com (2603:10a6:209:2b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.14; Sun, 17 Jun 2018 10:07:40 +0000 From: Omer Efrat To: linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org Cc: Omer Efrat Subject: [PATCH v3 5/5] staging: use BIT_ULL for NL80211_STA_INFO_* attribute types Date: Sun, 17 Jun 2018 13:07:36 +0300 Message-Id: <1529230056-18004-1-git-send-email-omer.efrat@tandemg.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [37.142.120.98] X-ClientProxiedBy: LO2P265CA0157.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9::25) To AM6PR02MB3621.eurprd02.prod.outlook.com (2603:10a6:209:2b::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5be33069-9c79-4b87-d6ae-08d5d43a2935 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(711020)(2017052603328)(7153060)(7193020); SRVR:AM6PR02MB3621; X-Microsoft-Exchange-Diagnostics: 1; AM6PR02MB3621; 3:CN+GdljL2jfn1Bt9mp/DcSM2LFV03PDCdwvO36oDH1FkaZt8TiVMVYrfZ2RiUl7zRRo2mjCKtKjp7ZSWT/77e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5Yd8TsjSp2fM895bGC7leDlar+R8jREn6ya+mCB+1k/UsnNmeIFdjKO/EG05X2EYNB9WGefg4X2AofjudAg==; 4:jZgcgbLIMtLBU2lk9Dyj7tqq5rWLILiXxwMCykVcAhmWxV0xTHWJ2TsruMlAzZDzAl/pqHXqwKa7yCPn/LXo4ApIalHTFgH0tQytF/+gUy1ZYJKPSkPYmHTnOMVscl4FoTKF7f1wX8BAVYjiQxvsQnJLYxBZJ2/tJUZFHjia4sPT09TQAfbU+ETgaThbfnnPcPHsMoKQ5Cgbe/3/1OU+Ue068X/XQGbDNvrDr7kGH2VILe6nx0xZSK5T3dyM0t/d0r1zLx7NJeHTnWI8t3iiaA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(3002001)(93006095)(93001095)(10201501046)(149027)(150027)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:AM6PR02MB3621; BCL:0; PCL:0; RULEID:; SRVR:AM6PR02MB3621; X-Forefront-PRVS: 07063A0A30 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(396003)(366004)(346002)(39380400002)(376002)(39830400003)(189003)(199004)(86362001)(81166006)(81156014)(44832011)(105586002)(106356001)(15760500003)(8676002)(486006)(52116002)(51416003)(6486002)(16586007)(2906002)(6116002)(956004)(316002)(478600001)(25786009)(2616005)(47776003)(50226002)(3846002)(476003)(8936002)(5660300001)(66066001)(6512007)(186003)(6506007)(97736004)(16526019)(305945005)(36756003)(386003)(68736007)(107886003)(4326008)(6666003)(26005)(53936002)(50466002)(48376002)(7736002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM6PR02MB3621; H:omer-laptop.tandemg.local; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: tandemg.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM6PR02MB3621; 23:1bsMwbKVq9yMPRaT1XZ7xCj8A6v529EgnVpPPGBwK?= =?us-ascii?Q?712K9uwt3ylKiFczZPoP87Lh+bS8TeZsqfLQs5hFOfD6Bv4kzZt3d2Z6xyR0?= =?us-ascii?Q?kqO1sgCjnbnytjCiQasF+AiYLdJKfbiEiHCj7fS3eeD7Mdp4trkO+GpkPY+G?= =?us-ascii?Q?14QkCJ/ijOEbox9FIqUrxJBBmJX/I8PTnxt/wLHwZ3WNdhnkOqXMCcwJDkz6?= =?us-ascii?Q?Piradu3awpeKGjbpbPEJavEtdiNBdI0p2EaVEGoVeqzv3NXWv/NNUrzQc9Oh?= =?us-ascii?Q?yILw7N+bgruJyxm5SJhNcrdfD12iGTRWvP3/pXBoGOIuLr9mHBSq+JdmSHWq?= =?us-ascii?Q?FDqmfYWe3H1utG/f0/CuVVaQ0ZjaL/Fi8Z8dgC4i7OFXyPgPv/88E19E+gp0?= =?us-ascii?Q?xrN7bII2vKUdxpB174BmGckRLaW8yDWb5EV7FKb0gJcX1AksTbfEpL75KIqo?= =?us-ascii?Q?tINhlkBaliJRN5OtbPv54DR7vPyrcA35K7YXfWAGLJ7A2vXaEHh03UOVJ6nL?= =?us-ascii?Q?71R4Wmhm8wj73RwHtci6BwNHzgpcvuo276jxHzM13NioR4vgAKU619En47fp?= =?us-ascii?Q?I5jGLZUDsozuBZocLt8aHpPuHgKsEQ5yLprnNSV3cJFUXX5mHTmICLX3f93N?= =?us-ascii?Q?G7sow0KirO51SEIgPO3cr8V0KR9xeHM4pRxpidQAJD/D1L6MSMydiLdL2M5B?= =?us-ascii?Q?z4nNkhkX2DljAwTH6eIMeMcF8Wexf7x2DGcVYtolagzA0vLr/+h9kGoe1D4Y?= =?us-ascii?Q?kUFboFa7VUBT5iZrV5jInwS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bRDK0yX/VpzgQ8wapeMjhcDhmneNiNnVml0k2tqr0M8MW5tpdEScp1x33eSbqF6bLw8L8J+PjuUOGXfxr5R8Sk8kII+qwlG62le98V/V+Fg+tGCl8T9sI8g/RLFjfgQ==; 5:bcUvuI7JVV0zQliNlni9W3B+EpG9ea+3ute0fKIacq/yXqoA2NeRausDOiHFYRANlBxhRepzbGfQfdPvCr2xGoMZyCob7Cf8XMcTNNPC/HR56xJnzx5KQbYeaWUSz3ApA0pW5lBtulN/xtlQHtvTsmm1/a6Hfxxmz4vosnbry/E=; 24:wc39It23I/6mMw6KyfdB3NVwKblvmsYS5oq0O4ysiB/76BbOMMKrvtW8JLXnRwO3uM4C7dvaFRBwZA+EepDi3btLqeoshs9DM64bRRgeIE8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM6PR02MB3621; 7:miGkXhFGVLbpMPkJ38Jl2wO04tc5Iy8asx23VUNLAmoJ/cUZOXuBsIcJUZfNdFFgmMe5m2XbAdzEtAFC3M39XjiDKEYaTQzDUSLm2+Dqdki0HuwKeUnnHryn6iWf5HKS8pRG11QBrfTBhLhaiHv4ssydBquDeGCGorMTKkUJAN7wLrxEkMRkLTF7loeibnBPTEZklHoP5a0DwYKnPITddVZ+PjPvwJOdhmqZrhw0F7n8qMSgh4rX1aRhpkk+O/1W X-OriginatorOrg: tandemg.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2018 10:07:40.3472 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5be33069-9c79-4b87-d6ae-08d5d43a2935 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d690b55a-f04a-454b-9f62-fb1e25467a25 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR02MB3621 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The BIT macro uses unsigned long which some architectures handle as 32 bit and therefore might cause macro's shift to overflow when used on a value equals or larger than 32 (NL80211_STA_INFO_RX_DURATION and afterwards). Since 'filled' member in station_info changed to u64, BIT_ULL macro should be used with all NL80211_STA_INFO_* attribute types instead of BIT to prevent future possible bugs when one will use BIT macro for higher attributes by mistake. This commit cleans up all usages of BIT macro with the above field in cfg80211 by changing it to BIT_ULL instead. Signed-off-by: Omer Efrat Acked-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 10 +++++----- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 14 +++++++------- drivers/staging/wlan-ng/cfg80211.c | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c index 02178e2..26b838f 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c @@ -1273,16 +1273,16 @@ static int cfg80211_rtw_get_station(struct wiphy *wiphy, goto exit; } - sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL); + sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL); sinfo->signal = translate_percentage_to_dbm(padapter->recvpriv.signal_strength); - sinfo->filled |= BIT(NL80211_STA_INFO_TX_BITRATE); + sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BITRATE); sinfo->txrate.legacy = rtw_get_cur_max_rate(padapter); - sinfo->filled |= BIT(NL80211_STA_INFO_RX_PACKETS); + sinfo->filled |= BIT_ULL(NL80211_STA_INFO_RX_PACKETS); sinfo->rx_packets = sta_rx_data_pkts(psta); - sinfo->filled |= BIT(NL80211_STA_INFO_TX_PACKETS); + sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_PACKETS); sinfo->tx_packets = psta->sta_stats.tx_pkts; } @@ -3013,7 +3013,7 @@ static int cfg80211_rtw_dump_station(struct wiphy *wiphy, struct net_device *nde goto exit; } memcpy(mac, psta->hwaddr, ETH_ALEN); - sinfo->filled = BIT(NL80211_STA_INFO_SIGNAL); + sinfo->filled = BIT_ULL(NL80211_STA_INFO_SIGNAL); sinfo->signal = psta->rssi; exit: diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index e248702..13d3918 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -1141,7 +1141,7 @@ static int get_station(struct wiphy *wiphy, struct net_device *dev, return -ENOENT; } - sinfo->filled |= BIT(NL80211_STA_INFO_INACTIVE_TIME); + sinfo->filled |= BIT_ULL(NL80211_STA_INFO_INACTIVE_TIME); wilc_get_inactive_time(vif, mac, &inactive_time); sinfo->inactive_time = 1000 * inactive_time; @@ -1150,11 +1150,11 @@ static int get_station(struct wiphy *wiphy, struct net_device *dev, wilc_get_statistics(vif, &stats); - sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL) | - BIT(NL80211_STA_INFO_RX_PACKETS) | - BIT(NL80211_STA_INFO_TX_PACKETS) | - BIT(NL80211_STA_INFO_TX_FAILED) | - BIT(NL80211_STA_INFO_TX_BITRATE); + sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL) | + BIT_ULL(NL80211_STA_INFO_RX_PACKETS) | + BIT_ULL(NL80211_STA_INFO_TX_PACKETS) | + BIT_ULL(NL80211_STA_INFO_TX_FAILED) | + BIT_ULL(NL80211_STA_INFO_TX_BITRATE); sinfo->signal = stats.rssi; sinfo->rx_packets = stats.rx_cnt; @@ -1775,7 +1775,7 @@ static int dump_station(struct wiphy *wiphy, struct net_device *dev, priv = wiphy_priv(wiphy); vif = netdev_priv(priv->dev); - sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL); + sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL); wilc_get_rssi(vif, &sinfo->signal); diff --git a/drivers/staging/wlan-ng/cfg80211.c b/drivers/staging/wlan-ng/cfg80211.c index 4291225..07c52e3 100644 --- a/drivers/staging/wlan-ng/cfg80211.c +++ b/drivers/staging/wlan-ng/cfg80211.c @@ -282,9 +282,9 @@ static int prism2_get_station(struct wiphy *wiphy, struct net_device *dev, if (result == 0) { sinfo->txrate.legacy = quality.txrate.data; - sinfo->filled |= BIT(NL80211_STA_INFO_TX_BITRATE); + sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BITRATE); sinfo->signal = quality.level.data; - sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL); + sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL); } return result;