Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3079516rwb; Mon, 15 Aug 2022 17:37:14 -0700 (PDT) X-Google-Smtp-Source: AA6agR4O1JPohkgxNrL+7Woc1ZKtvmNV1zYeUtPtp3Uc/o+5LrVFvwFnxojxoI9p2+k8ZQVxkycq X-Received: by 2002:a17:90a:7407:b0:1f4:fe7e:bd51 with SMTP id a7-20020a17090a740700b001f4fe7ebd51mr30760011pjg.218.1660610234090; Mon, 15 Aug 2022 17:37:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660610234; cv=none; d=google.com; s=arc-20160816; b=Jz4zC7VM7tJV2cNoFjcBCTkZcNbSTtO3AN8iKNM4MQ/bj4aP4FWLpvAJjoxDkO4NSJ Ep0ReU1ef0dWZJAS+u9iP44TOaZ5uYdgX240jnWn3Z5fkdfcDRbrKnZWuvPOmS9uuuO/ k5t//YG1XeDDPclyS5kBvLxuI0S/yF8H1x66j6uEaq3iXTs83bcxVFZK+qqNUyObQWvF 5iCChuubIhPsaJoPwhlhQTappbDwqpoaFEVJ7b48QY4GgXf9o7OIXapUKYw6Z6CJzfMf HeG5myUTTF+ZdaqL5CwsAqZEZuGbgYGuoF/67sEFTFc2d+wdv9n5ZlmfMnJYWLsful0j 3xCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uhxYs/QIT1ozB0adL+GMGRY4ANBjjX8/6VUTlQm2uMA=; b=IVDBp35B0S3FwQZJmSLsK801ywWfFVQZvJz9LnKNAF6xnL3mGv8k/0PQvE6LXDsWhQ Cg4iAcJ/wLqAeEbK6yjUCisuMfcbZReGCJy6tbc8D9AlOWtd1/r1JQAy3Sop1auvhjLy JxcWncYrdReyBq4Rp6wp1p+RhZu/jT3m43v/AkVusXp74TJ3uakG6Y7SkK2Q3NdFvBwG 4SJEThFywcL4maloWY0aaLZ7KLQx2e25jAEstiU39+fBTl4TtJb05d7GwbJK2quX8CgR nu5KNcvwltaVrQvaIz+IQXgd3/CRKxnvQKT3xbbst20p7Ms6eNWRHWs9u7z0M5IVRUdo 8eiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=C9noWkex; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q20-20020a656a94000000b0041c5f9dbfa6si10691692pgu.62.2022.08.15.17.37.03; Mon, 15 Aug 2022 17:37:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=C9noWkex; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355148AbiHOXvd (ORCPT + 99 others); Mon, 15 Aug 2022 19:51:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355045AbiHOXrA (ORCPT ); Mon, 15 Aug 2022 19:47:00 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 607DB1117; Mon, 15 Aug 2022 13:15: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 ams.source.kernel.org (Postfix) with ESMTPS id 50784B80EB1; Mon, 15 Aug 2022 20:15:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A70ECC433C1; Mon, 15 Aug 2022 20:15:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594513; bh=ipv9dfXXVqAtoVR/NxjiBYzy9by7wrxc6uBHn0fl/lw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C9noWkexd5sBS3/3/I0yST62q9v6hPTF4+Xii8ImtlwAH8EAF0N4hRK54hOHJoy/1 Id7Kn+V61cBm5LpTvstAkdrt7Dj6tRS/QLRxkLcU7oonGPpwT5kFT7FEjaKBgtjMW1 uJCHfYsjNGAeDgnqgnVOq0Q7QFYI9zYu9Owb0iXQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Felix Fietkau , Sasha Levin Subject: [PATCH 5.19 0470/1157] mt76: mt7915: fix endian bug in mt7915_rf_regval_set() Date: Mon, 15 Aug 2022 19:57:06 +0200 Message-Id: <20220815180458.411176288@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit f572dc969a59a80baa22bf2f7c9af0064402652f ] This code is supposed to set a u32 value, but casting will not work on big endian systems. Fixes: 0a17329ae9c1 ("mt76: mt7915: add debugfs knob for RF registers read/write") Signed-off-by: Dan Carpenter Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c b/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c index d0c719ecacd0..fd76db8f5269 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c @@ -985,8 +985,9 @@ static int mt7915_rf_regval_set(void *data, u64 val) { struct mt7915_dev *dev = data; + u32 val32 = val; - return mt7915_mcu_rf_regval(dev, dev->mt76.debugfs_reg, (u32 *)&val, true); + return mt7915_mcu_rf_regval(dev, dev->mt76.debugfs_reg, &val32, true); } DEFINE_DEBUGFS_ATTRIBUTE(fops_rf_regval, mt7915_rf_regval_get, -- 2.35.1