Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2987294rwb; Fri, 2 Dec 2022 19:24:16 -0800 (PST) X-Google-Smtp-Source: AA0mqf6JuAYzWDV0Rqyz9u9LiVs8N5b/l1uSWeSutbiQ3ocQcUdwLohhaZlgCKOA9sYv9vEE6bsW X-Received: by 2002:a17:902:d711:b0:17f:cdd1:7ab1 with SMTP id w17-20020a170902d71100b0017fcdd17ab1mr55959471ply.86.1670037856321; Fri, 02 Dec 2022 19:24:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670037856; cv=none; d=google.com; s=arc-20160816; b=U5UmtQpGegaPhpVDwFXdlN6gBKoIxKrdvhMiHIwcQhe/anNC0zWewDi/L5P/llCHe0 +a7QZBo4KjdWvhVDoHXC5+LfzpCaG/azcVs/8lPT4XSCx1L8yIYkbp+x93IpeFvBbd4V jfySn/1K8SuvHUAl9F+QQCAhuLX9AK8cdlsztDnD4KGG81enttBrzmcYe4cWsHOdb7Vy ZGvBYbgCLcImvS3wfuFosuGIJCtYyq2bXF2sKJ06j7Xj1P2ihUzBRLYd+XPpFeJiOwBk HFVH5BBkijhrjky04zkr04gCOvUNNcRBcMZnDD40ZIqsCYZ/MCToqSId99pKYK6gQWZD I/lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=CLA0MJYAKVZmh7ivBYheuQmNw2QpaVtX8ZoW3soALIU=; b=qV2WfYGKXAyib2FtAROpKIznsi0gpkxxScrjUN9ELjT0HM6T3nvSmM9JUtkCTaCYfi OrkvowBfLfkXycbzC6gJUHbhLAaEUdu2tTbTPvGiCC84tYniwurXaDAa8UvEzTKOoHJO 6707qNtCOE5DwcTxHRTlwo1pEnfQg1ZOtFy6QBDbjkxZ3Vs4anVWlgdLeDXqfyth0gdI sSiiymAqaidixvCyv6559stsA3Wm3EPRGh8+ODIZx0F/K00DD0/fr6xEKGlXdx5R/lUZ AP8IYMLayQG6TG7J2+HqlYQMEexapu7NsfUzqGev5uGUWkTYYsOrq8MVWoL8hU4V4URu XXcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=UpZVMi9C; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e2-20020a170902d38200b001868d5fc27csi8441966pld.254.2022.12.02.19.24.04; Fri, 02 Dec 2022 19:24:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=UpZVMi9C; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229823AbiLCDWq (ORCPT + 66 others); Fri, 2 Dec 2022 22:22:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229951AbiLCDWk (ORCPT ); Fri, 2 Dec 2022 22:22:40 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 162202FD for ; Fri, 2 Dec 2022 19:22:33 -0800 (PST) X-UUID: d9907b2a07a443dfb5beed627964e14c-20221203 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=CLA0MJYAKVZmh7ivBYheuQmNw2QpaVtX8ZoW3soALIU=; b=UpZVMi9CfXfJWmChECCGz0rqNtJb3JOY9Lbpi+blYeDZy6PSUfP5u1ahOTIhDXkfRdXZCpyDODHMLQ+yr0Cb+MCIUAS2mwQhnVw/gvxDpyWexxBciZwj4Uhe0ccIE1Za6VKf0kPbfC9x+l01vroteUqwZoufm8poB5pBUIAfUko=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.14,REQID:564e6acf-a564-428e-93ef-bfe47caf3e80,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:dcaaed0,CLOUDID:2a6b8b30-2938-482e-aafd-98d66723b8a9,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: d9907b2a07a443dfb5beed627964e14c-20221203 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 465167930; Sat, 03 Dec 2022 11:22:28 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Sat, 3 Dec 2022 11:22:28 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Sat, 3 Dec 2022 11:22:28 +0800 From: Ryder Lee To: Felix Fietkau , CC: Lorenzo Bianconi , Shayne Chen , Evelyn Tsai , , Ryder Lee Subject: [PATCH 4/4] wifi: mt76: mt7996: fix integer handling issue of mt7996_rf_regval_set() Date: Sat, 3 Dec 2022 11:22:25 +0800 Message-ID: X-Mailer: git-send-email 2.18.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This code is supposed to set a u32 value, but casting will not work on big endian systems. Reported-by: coverity-bot Addresses-Coverity-ID: 1527816 ("Integer handling issues") Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Signed-off-by: Ryder Lee --- drivers/net/wireless/mediatek/mt76/mt7996/debugfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/debugfs.c b/drivers/net/wireless/mediatek/mt76/mt7996/debugfs.c index 2e4a8909b9e8..99b23aef53a5 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/debugfs.c +++ b/drivers/net/wireless/mediatek/mt76/mt7996/debugfs.c @@ -653,8 +653,9 @@ static int mt7996_rf_regval_set(void *data, u64 val) { struct mt7996_dev *dev = data; + u32 val32 = val; - return mt7996_mcu_rf_regval(dev, dev->mt76.debugfs_reg, (u32 *)&val, true); + return mt7996_mcu_rf_regval(dev, dev->mt76.debugfs_reg, &val32, true); } DEFINE_DEBUGFS_ATTRIBUTE(fops_rf_regval, mt7996_rf_regval_get, -- 2.18.0