From patchwork Thu May 19 13:57:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 574504 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 00EB9C433EF for ; Thu, 19 May 2022 14:02:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239463AbiESOCO (ORCPT ); Thu, 19 May 2022 10:02:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239565AbiESOAb (ORCPT ); Thu, 19 May 2022 10:00:31 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9945EEC33D; Thu, 19 May 2022 06:58:39 -0700 (PDT) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24JCxsds009233; Thu, 19 May 2022 13:58:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : content-type : mime-version; s=corp-2021-07-09; bh=OPLKH6QRLHnZLvghbm6oc6FwmL7O2t0XVxH1l2nLSys=; b=SyIqKVcXoef6OFjOUVlYUxp0hNxkFtzspZ5KU9sQ7EqelJ56xl/1rBe6NWZKvIn57r+i +tfO/2lgmThnUmB5pdXNzrjYJYOT0KHbRFgtcV6+PBBgo22OlU/rq72h+ByFCKOJLZAM ZawUKGgtb0tjBNEmOI1yhw1PSkjP3F7IWC8ZwMZSYod/SzUQfDuxQ8n/4A61FF8PIbVL 0M0ygffdo0FrJB5j947AoEwNsg2+iUleHikF9TIOHmLfRUNnVqEiC1gof8ffrVjIpVxx hkPKZ9DD5bIVjVWXoRJ9pdc3g3BnXHPDWkPVbLw6OuvP1hn5HAS3UcsfQ/c/0NSgFOUD qg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3g2310vaw7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 May 2022 13:58:16 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 24JDtqPQ025119; Thu, 19 May 2022 13:58:16 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam07lp2047.outbound.protection.outlook.com [104.47.51.47]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3g22v5fp6r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 May 2022 13:58:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=blfH+vLZN9gbmBkBF1+0YUpPZn6dyMFVYQ3Cu334fNi8L2aPUdkXG/4i8GMvf2dNbNo/5zrZSJpxgYWLF8Av6qVRJ8jyvjN6sU0lVVQOcnaXqvey2ni5/BYaBPjz/SYZq8zP2k4MqMFnqjFHWG3DHbYlUvYpb2f8zw2wVgyaynlF5smhQLtuAd8EiO9dxZT82zQp3XuHgEHp0eVZjriF1E5E8WAzQiG4spDcRubLSKDIApJZn8v14b06mfb/Vaz7w7LhMbwKzsNaASkXPtQzIvFPtiDuQgXQn1+Y+PGKs3x6vgy1hIUi+iiMx7rNuhV0FhKPdv/+jlUh4khuXWYffg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OPLKH6QRLHnZLvghbm6oc6FwmL7O2t0XVxH1l2nLSys=; b=jNt5OysMkRFH+qfYHWVFC0fHkSzOG1jZvPe+Yo8/H6nATcwscBA/m/8IkZUu24m+eoVYgQaxHbMSdFfArR6ZvbSKgQ0twIPGeZB47tuoXZGWCFOO1qQj0gDWaOe+FHyJbTbwUZ3S3C/0bfXIvfmnlcH1lNgt7K8hxf9tNgtYPRphkJPrQt/ivgr1Q7E2SWVSrlf7Ko13N7UqYaXvudZAC8gxvoD3Y7n17gYW/6+i2ri31+QV7iZixAnDdAoszRExhoiTCuUPaYVtcIrptmG5PRmKZ99V03jznbLYJ536FzhFw6sun+zEMsiiggfjJ7WvWMkY5UD0kzlHV1uyUKqsPA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OPLKH6QRLHnZLvghbm6oc6FwmL7O2t0XVxH1l2nLSys=; b=VPOQ/zmMIPCRKltISI68N+yfC46cs9+0VzkDJrU6T248C6IK1pqHBnM234gqoMvKC1X/wxNFD/vzTwiWbOCR7CUU1CuGs91Hlm/FXnUKEldf+JMVQWnwH6JL6jxhfSCJTkKqcsmqn7Tg/DXW1nEyWbpXZea2vvQLKOrzRWCZ+OQ= Received: from MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) by SN6PR10MB3023.namprd10.prod.outlook.com (2603:10b6:805:d2::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.16; Thu, 19 May 2022 13:58:13 +0000 Received: from MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::86f:81ba:9951:5a7e]) by MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::86f:81ba:9951:5a7e%2]) with mapi id 15.20.5273.014; Thu, 19 May 2022 13:58:13 +0000 Date: Thu, 19 May 2022 16:57:22 +0300 From: Dan Carpenter To: Felix Fietkau Cc: Lorenzo Bianconi , Ryder Lee , Shayne Chen , Sean Wang , Kalle Valo , Paolo Abeni , Bo Jiao , MeiChia Chiu , Ben Greear , Peter Chiu , linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org, kernel-janitors@vger.kernel.org Subject: [PATCH] mt76: mt7915: fix endian bug in mt7915_rf_regval_set() Message-ID: Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-ClientProxiedBy: ZRAP278CA0005.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:10::15) To MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0170193d-0170-4ac1-f9da-08da399f9d60 X-MS-TrafficTypeDiagnostic: SN6PR10MB3023:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h3c7r58lPXmgWMYsTPosvIg6YWGRby5wv6Sz2VZ64SmaKrDwhpVeIq58hdwgqysJRKKZ0EZJbWwLMjAKB1LzFkZc8222nUYeDndqq1LybuwKXgBVUf41EXhhiFCJFjIEu2cESkxNbA8+KYE+tYh37gqIii5wx+B5ZJqyyRI4+FwfvoH/cdKxx+cCS5uM8K+6spCSXGRUgT+Q0tvthy0XQZ9wf9kumYTAe8kS3cL6yvHcZ6+VH/aFHNqwvcrvwqqZVbOxh9l1ueAXv24CpRsbglCsZChGDp+rLqjHX7iaMvwhdUPyAiPRMrNJ6r5hHn+aJ5VeX20ARoO6LmGXFQhk7N7JVqIQfO1Zanhz5zuOFgarKNGwX07q9RpPt6s9f2XEMgyRFtlItINmYw5mwmqVn1QC04eC+tkysFIvRwIfKmZZUH6FfO3XC79Fac7baNM0sARe2uqaCxf7mu604dVFxJwx7IH9PaFwC+bOTY+2J65EvVTbwLfp+f9ZT/y/0L+ksO9+OSLyEBfI32GM4t1TWaYJ+vi3YUphf6vcM8xvNwF/pz1ePpwLZAJ2Jl3XnVpgadaRt067jQkEz3XrcPHHBW3FhMRANQtNO4ceAK+/fmDe6J1CZzO1J8eDcudFNbfS3alDVKHMKZh1b2MPHJaCBKlK99cLlc+5WCD8ES6dPVs/pefVmVXOBCFw9G/6z65VZw0r2HDD5CuSqeUuIWxqsg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR1001MB2365.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(7916004)(366004)(86362001)(54906003)(4326008)(6916009)(6486002)(66476007)(8676002)(66946007)(5660300002)(316002)(66556008)(83380400001)(44832011)(4744005)(7416002)(508600001)(8936002)(33716001)(186003)(26005)(2906002)(52116002)(38100700002)(6506007)(9686003)(38350700002)(6666004)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4fHaYD3iA569RI1pFCDkO44Ws8R3XtqgzidJtzPC1JpFgfJ/4rZ/qJz0pa6uYsmzUeXTFAYnKz1iIyFE9AmnMWKLGuWXjy4thxKv7153hNRoKTsOr2rYWniqGfMZpZ3uzy0nIdE7RBYCPBVIHByWqV7kPXVZTfpcsAuoR7aNkXIOo81jvQDw/XGrGw24/n1mJx2ObOV0K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o5WxG1+xfk0XCmoTSLpCA6BITpEtFKNcrTcESlijikwnBbtzKYWT9rqRDo2Z+c5xh55HOQiYl7Tqv6qCXGED+t9lzc07Kq7m0deCp8LCjObox+FauMsf4uF/WLOM5sF1sOPVA8662XOwYJRMF5MU+T5tY7h3aEyI13etCI0FmxIJllkgDCzIXIEq9BGxCvvQrfewPzB5dECmpJCWU/9Ef1CabIfJMiiBwBUu5aTEhciahq4QTO7vXAW4vg4AQ8vAYwxxeGsDoYRJop/Lz9GW5Z3TfCQUUJGgYa+HlpH64tW2Q9vMGK6A6qU149pVrZNRp1YWuAjGe8TOItpr8R1DjKaS1D6Wz4LO2bcuLDs23HhBIusUCGnTlqBBoltOXXX9wBC7sk3KUOkv5/6q9gP/J54voFPWy22xg79kJG5QrR+OnXZZ4HD2eJe42lLTCkYPY3WdT275Bp58I22HmSLR7amTq72jQ5VqIYWzQJd2P+bHY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0170193d-0170-4ac1-f9da-08da399f9d60 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2365.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2022 13:58:13.0401 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: YnxRJWbw//At5A7rSZRwAOpgC+5FGtM05iqosGpdhjKzkuQKU18U348tEE09U6sc8nixgBN+C+xbuQtEtF5BGDYMm+gfB9g1FYSIPfNbQa4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR10MB3023 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.486, 18.0.874 definitions=2022-05-19_04:2022-05-19, 2022-05-19 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 mlxlogscore=999 spamscore=0 suspectscore=0 malwarescore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205190081 X-Proofpoint-ORIG-GUID: xp_zIaBwmZZyiyguDtc1jXlF5gWdYZLu X-Proofpoint-GUID: xp_zIaBwmZZyiyguDtc1jXlF5gWdYZLu 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. Fixes: 0a17329ae9c1 ("mt76: mt7915: add debugfs knob for RF registers read/write") Signed-off-by: Dan Carpenter --- 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 cab6e02e1f8c..5dc8ef8cec83 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,