From patchwork Mon Jun 18 14:18:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omer Efrat X-Patchwork-Id: 10471653 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 C7A4E6032A for ; Mon, 18 Jun 2018 14:18:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B87A2286DF for ; Mon, 18 Jun 2018 14:18:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA7C02871F; Mon, 18 Jun 2018 14:18:24 +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 80F88286DF for ; Mon, 18 Jun 2018 14:18:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934670AbeFROSW (ORCPT ); Mon, 18 Jun 2018 10:18:22 -0400 Received: from mail-he1eur01on0115.outbound.protection.outlook.com ([104.47.0.115]:10349 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934470AbeFROSU (ORCPT ); Mon, 18 Jun 2018 10:18:20 -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=PhQZws6RwO/dAu7a60H8Nvg5y3UYP1cNswuf1MjoLQpH0oqiz/fYWharpVuqPsp3so8udu0n39A/ZdzrYSV8xPhog6Xh6MrxqYs6anR3/SGc7c/3rsi4Ht6WU+/5M4um/hNLcdr6QJAYdhPkk+BihhHWXCTPURCdWHDXAzdAECQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=omer.efrat@tandemg.com; Received: from omer-laptop.tandemg.local (37.142.120.98) by VI1PR02MB3631.eurprd02.prod.outlook.com (2603:10a6:803:32::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.19; Mon, 18 Jun 2018 14:18:16 +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: Mon, 18 Jun 2018 17:18:11 +0300 Message-Id: <1529331491-1331-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: AM5PR0402CA0010.eurprd04.prod.outlook.com (2603:10a6:203:90::20) To VI1PR02MB3631.eurprd02.prod.outlook.com (2603:10a6:803:32::11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c11017cb-d2fd-47f3-42b9-08d5d52655ec X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(711020)(2017052603328)(7153060)(7193020); SRVR:VI1PR02MB3631; X-Microsoft-Exchange-Diagnostics: 1; VI1PR02MB3631; 3:GkbyL/TGDlTrKYUSth3xzGZSF1P+UN1jwgUQtbd7aXbWqwedZouDCEs34dSSXrxZul7UjbwV1OIW/1HIq8QnRGOQEjyIX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+l+kWnd6TrEQke8N61BKox331wlhcPLDDMufX1pmRSbZnLT4sY5+71YqczQy6dfEU16imVH+kcUH+HkYcIl822vw4FNGE9lT+MbYvQ==; 4:gvf/Fn/ialktYnRTjmOooGzpXi2bwBouNTgxWgxIu7NJSEVFhFh9dmaofqbqh8O0E1JNsLXD8veQN7z8QhZQcqQocJmlwo1INouixI7z6hHS7kdUVBHmiKJfRfDOWSZDylcY87OgaagUVa+OVMnWZD/LKJwWnFkZ+u7WBbjKwkik1k5tqgNIyf0KPWv+QbuDYT1VufTSojKOxse2HMc533vektY0QXLshcRAc5El1+Gguwu7BqYJ4GFTajM4fk2uortM6Rr+Q1fnra7CG4P59g== 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)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:VI1PR02MB3631; BCL:0; PCL:0; RULEID:; SRVR:VI1PR02MB3631; X-Forefront-PRVS: 0707248B64 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(39380400002)(376002)(346002)(39830400003)(366004)(396003)(199004)(189003)(2906002)(86362001)(7736002)(105586002)(106356001)(6666003)(16586007)(15760500003)(316002)(68736007)(478600001)(305945005)(97736004)(53936002)(36756003)(3846002)(6116002)(486006)(386003)(5660300001)(956004)(44832011)(2616005)(476003)(8936002)(6486002)(51416003)(81166006)(50226002)(107886003)(66066001)(25786009)(47776003)(4326008)(186003)(48376002)(16526019)(81156014)(6512007)(6506007)(50466002)(8676002)(52116002)(26005); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR02MB3631; H:omer-laptop.tandemg.local; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: tandemg.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR02MB3631; 23:0JPt4uvHyLh4HHo6n1664PpzVe1wSEjo9T5fnTBH6?= =?us-ascii?Q?jYzN0WPjS/EjrqpmSMh+/sMHg95eZ3wkLIXsbEavH0+3kVsNV3Bbr2rsdq4W?= =?us-ascii?Q?tEpClqtIFkjHWxzQHAJF6k1HnfeIYka5/3imZWY0pxUK0CxsqHqZoSRQc7P5?= =?us-ascii?Q?fSpso2Yk6Qk8w8M1MH7st+OWsic+/r5YHrh5PhmaAZMS9flR9rlwbt5sg27O?= =?us-ascii?Q?ziKobJjnPi1WDM22Ll25teQCJqO9thi///zKCU1sZB1Vz4VXDFqIA9JfddvD?= =?us-ascii?Q?AbZbaJghCZae7yj6N5k6bP43opJe9uuVfu7Hvlwb3H2Krr9AzRYRwM021ZuJ?= =?us-ascii?Q?QRGB/rZnZBKjAOYT5rcYR3bHY6p8b056fskAFSMZO7LYoD57v87lriLGXxzh?= =?us-ascii?Q?PvZvXWBVag6WOgO7xMjPBhDbk0wMA2EBQU83c9F+QDHzdgug+LK6+Lssd/bO?= =?us-ascii?Q?w6wzz3L8ms1D9FcDH35hFSfMiWtu/Wx5cHmAMJEXQySXICEW8jOOmpSTPnZ3?= =?us-ascii?Q?AfEG+TkN2NOxmNER1kpwSip1j14e61PJub0JMN+IeIP693rZObwOEaoN18Zr?= =?us-ascii?Q?KACgW0Qw22fcneu52TNm2eL4Xt+c6KcxT7n/znWmP0FZoZ/HJtr+lZNhP45G?= =?us-ascii?Q?dLgUHH+VCCDuTeSoL8phVr6fZuqEVY1m5cPxtz4jCv4sjD3sTsY4HuWaXD0H?= =?us-ascii?Q?ZRWb0DualFTsmTw4PZcXSz2DnicbhkILwqM6be+tT7I57WWimZmIUf9rVoM+?= =?us-ascii?Q?KeHaE3pwJ8ckE7QTjxassEPIPJihDnm5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GZq6/FFxoC+SvGHTwHj6z7B53zTl/keT2qGv/dJUbGUDRq2fn+1r6MzxCQNxQoBrMt1LlWMISZ6Yi277UYUWujv/0qR80CPf72JHHjLxByhtONpsnSeTz3i+OlvvXJCg==; 5:g2JK7u/keuhe8sTaElCuN+swJetczBexTIy//+BA3FHLHfj13jBcU3sw5BnC/9oaNjN8O7+zPoODbveBom/mAmXbTOd3/V3ljsp1sv8hE37R3/wfs7CDy5S+uAW4+PHO3wXI8OiDqPciNCoEohsdv3ZcZXcn0s4MR8OCqu/R7Io=; 24:oGllAdp+odrleB4VIzXCHL27qMHkZFbRkqnUdGTetmlHCPj6LR7KQD/K5LGhDEuMXqWVwZZqtbwuwps3O/8TuFSjBUZ1rIStXQVBvb4Oggo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR02MB3631; 7:/BHG//KKPudt1kfb+kzsaMCtgsgw4Gadl0rlMhOorJXuY8A7U58zx0lLPzAucQz4VIFERWidzOEeaJspX7bSuGqoCdRprXvARqIl5O3RQekMmpIDsuMSOXpMkzrcs4apaDWGKbLJHoK1xAkMG3spg4f/4MqUcu0TGKF+SI8xJj5vPTVtqD1PprLpywVFw91raqiEzWd9NIS9Tk0JxRCSCs/T79tFY1tMVaj90u+UzTtzvffVXaW5l/Fh3kUdiuQ6 X-OriginatorOrg: tandemg.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2018 14:18:16.4850 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c11017cb-d2fd-47f3-42b9-08d5d52655ec X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d690b55a-f04a-454b-9f62-fb1e25467a25 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR02MB3631 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 --- 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;