From patchwork Mon Apr 4 17:28:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 556493 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 869C3C433FE for ; Mon, 4 Apr 2022 21:16:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379049AbiDDVSg (ORCPT ); Mon, 4 Apr 2022 17:18:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379548AbiDDRaM (ORCPT ); Mon, 4 Apr 2022 13:30:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8668124BF9 for ; Mon, 4 Apr 2022 10:28:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2934760D29 for ; Mon, 4 Apr 2022 17:28:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D16DC2BBE4; Mon, 4 Apr 2022 17:28:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649093294; bh=T8rWXhNuqO8D+8WJdfkxSjv2dbhMzpbfLsgE+/tuISI=; h=From:To:Cc:Subject:Date:From; b=SFfUPGaJdPuOq1Tgog0cxE/ULb180aIxCXcNm7E5or5ti2zq4YJqBwAJyuNDjh9mX ITc0HuXEF4qc2N1B+gR05gRODRSAKumTtPG+ckXIA/7pqbgekZptECwX16KB1Umxba NOV23Bywv8reyRTGT3B+owVzQI0w+b/OOpvXySXYk7rQwTFup9Y330bGi99FYHX1j0 P+revV62irVoo3ZcFgL7vJW3RcjGQxm/QfRxAnDMntjsjQOqScJdn+nFacXllnWUEI PxFMODQSNlQmANPQ7gV8XQ1xtAP/j2AzCqZL3+XrU1Q2GmAB+6AKCRXNdv8g8vHoNr yVGWG2mHnqdSg== From: Lorenzo Bianconi To: nbd@nbd.name Cc: linux-wireless@vger.kernel.org, lorenzo.bianconi@redhat.com Subject: [PATCH] mt76: mt7915: use 0xff to initialize bitrate_mask in mt7915_init_bitrate_mask Date: Mon, 4 Apr 2022 19:28:02 +0200 Message-Id: X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Use 0xff (GENMASK(7,0)) in mt7915_init_bitrate_mask routine in order to initialize bitrate_mask structure in order to avoid truncating value in memset(). Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/mt7915/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/main.c b/drivers/net/wireless/mediatek/mt76/mt7915/main.c index 865694c755cf..9b8defb15b4e 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c @@ -174,14 +174,14 @@ static void mt7915_init_bitrate_mask(struct ieee80211_vif *vif) for (i = 0; i < ARRAY_SIZE(mvif->bitrate_mask.control); i++) { mvif->bitrate_mask.control[i].gi = NL80211_TXRATE_DEFAULT_GI; - mvif->bitrate_mask.control[i].he_gi = GENMASK(7, 0); - mvif->bitrate_mask.control[i].he_ltf = GENMASK(7, 0); + mvif->bitrate_mask.control[i].he_gi = 0xff; + mvif->bitrate_mask.control[i].he_ltf = 0xff; mvif->bitrate_mask.control[i].legacy = GENMASK(31, 0); - memset(mvif->bitrate_mask.control[i].ht_mcs, GENMASK(7, 0), + memset(mvif->bitrate_mask.control[i].ht_mcs, 0xff, sizeof(mvif->bitrate_mask.control[i].ht_mcs)); - memset(mvif->bitrate_mask.control[i].vht_mcs, GENMASK(15, 0), + memset(mvif->bitrate_mask.control[i].vht_mcs, 0xff, sizeof(mvif->bitrate_mask.control[i].vht_mcs)); - memset(mvif->bitrate_mask.control[i].he_mcs, GENMASK(15, 0), + memset(mvif->bitrate_mask.control[i].he_mcs, 0xff, sizeof(mvif->bitrate_mask.control[i].he_mcs)); } }