From patchwork Wed Aug 26 10:22:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 7075791 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0AF659F344 for ; Wed, 26 Aug 2015 10:24:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1DAC420932 for ; Wed, 26 Aug 2015 10:24:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9CC1F20933 for ; Wed, 26 Aug 2015 10:24:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756072AbbHZKXe (ORCPT ); Wed, 26 Aug 2015 06:23:34 -0400 Received: from mail-pa0-f49.google.com ([209.85.220.49]:35784 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751816AbbHZKXd (ORCPT ); Wed, 26 Aug 2015 06:23:33 -0400 Received: by pacdd16 with SMTP id dd16so156532975pac.2; Wed, 26 Aug 2015 03:23:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=NNOwnXjrUqkzqdUbBarwZSSARe/wXUH2pCmxGLLLLjs=; b=Cy0ll4DyqP//pQgg5spPfTB5q8eEOf0quDUxcCY2IVmkeBhi4Ufl2crwOX7K1U5kNm yKPjFbBJbmP9EFTX7RSWvNSj72vXy2fzpkkP9GN5xLj0zIz8I1fzogjlCKDaIz+Uis2G tm7raSUE4uMGgoUJifjSj0i2jFuEufIXkEbJq4eo0ogU5CMh1LgFJy6XEsvlCG6M/3FY zKvA25MoF+e/Hqv/Trc/NDDEhQGDQ1i7Ky0pAfBhtwWAUgmuZYAbBKnQ+9jYoJR9A7+w Rbwhf2Ws4j7hvebsHkk9dGMrVetcDrLZtuR0UnW0qzn7Loo0O4M/D86eH0ug6OQFzDma 0B1Q== X-Received: by 10.68.114.196 with SMTP id ji4mr67915917pbb.46.1440584612622; Wed, 26 Aug 2015 03:23:32 -0700 (PDT) Received: from localhost (port-3236.pppoe.wtnet.de. [84.46.12.176]) by smtp.gmail.com with ESMTPSA id jr12sm24108594pbb.91.2015.08.26.03.23.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Aug 2015 03:23:32 -0700 (PDT) From: Thierry Reding To: Johannes Berg Cc: "David S. Miller" , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] mac80211: Do not use sizeof() on pointer type Date: Wed, 26 Aug 2015 12:22:14 +0200 Message-Id: <1440584534-27251-1-git-send-email-thierry.reding@gmail.com> X-Mailer: git-send-email 2.4.5 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Thierry Reding The rate_control_cap_mask() function takes a parameter mcs_mask, which GCC will take to be u8 * even though it was declared with a fixed size. This causes the following warning: net/mac80211/rate.c: In function 'rate_control_cap_mask': net/mac80211/rate.c:719:25: warning: 'sizeof' on array function parameter 'mcs_mask' will return size of 'u8 * {aka unsigned char *}' [-Wsizeof-array-argument] for (i = 0; i < sizeof(mcs_mask); i++) ^ net/mac80211/rate.c:684:10: note: declared here u8 mcs_mask[IEEE80211_HT_MCS_MASK_LEN], ^ This can be easily fixed by using the IEEE80211_HT_MCS_MASK_LEN directly within the loop condition. Signed-off-by: Thierry Reding --- net/mac80211/rate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c index 9857693b91ec..9ce8883d5f44 100644 --- a/net/mac80211/rate.c +++ b/net/mac80211/rate.c @@ -716,7 +716,7 @@ static bool rate_control_cap_mask(struct ieee80211_sub_if_data *sdata, /* Filter out rates that the STA does not support */ *mask &= sta->supp_rates[sband->band]; - for (i = 0; i < sizeof(mcs_mask); i++) + for (i = 0; i < IEEE80211_HT_MCS_MASK_LEN; i++) mcs_mask[i] &= sta->ht_cap.mcs.rx_mask[i]; sta_vht_cap = sta->vht_cap.vht_mcs.rx_mcs_map;