Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp232874rwb; Wed, 28 Sep 2022 01:48:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7prQ58Ni73m/D37ZLO5AC1C8FGXfHViVvjBQDWKcrYxrrVrF5rdOmxvHPRtC4Q8v70nQbu X-Received: by 2002:a17:906:cc59:b0:779:f094:af3d with SMTP id mm25-20020a170906cc5900b00779f094af3dmr26032966ejb.239.1664354925496; Wed, 28 Sep 2022 01:48:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664354925; cv=none; d=google.com; s=arc-20160816; b=O61yUu2sEya5el+1UqFP6zCbxcBbCKztmkZy9b6hG5XyIY5BeUCylw2uXDREiz6WZE IK+sunDSOtGSTdPJWGhkmSL5UORrbHRPLhYJ5DeceQ13wUJqPCL7YFn9IKOH46Cx0f0e xsBgnTs4lTTcIfkfOOtIPT9BpJWl52agoYxUhlpenny3GNa5gW/SCumLuYqVxXWR8K/6 XxmV5gDLkq8y8HpC8caxzT6VOiVz2GCE7qvM2TFYsEcv7RKfenVbX3Zm27jNp2mMaa4N 7XRvYGvpxDvBFwavJOfq61BrlzopncdBq0j2WVRE/dEqaGE5aUk49MLieSnUnWY44NQB 1a/g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :authenticated-by; bh=Ft6AHNjqCHqr4wSLRlUmi+1QTicZhA34j8HjyrFO/AE=; b=wA8CXw22QO+FGmGmH8WV/2UJCzMSuB9+xnbQh61Nxror3//o72icpLys9+ll8RuA98 0/lYIQ9SVJUHQVP7/BWfIwLYRVEvJw9tKlg7tc0r/qncj/CtjHqEOcu/byM3r50fs5OF jH3MkZKmnv7dsFj2YkERHB2A6CMR9EeG0gzNgZAwejGb0NK6+7YVeRbSWk/ldkjI+ko/ N2QVKalO7NTUD2IcAkJgatqbZSCklC9jbVVDsSgs/jzJnBIntWvVV8EaoPqilbhjTNQn xHX2cK22+pbI8qnDBRJgzelviCCL9VmEEmasDdrA3FcuPM1aOrfhY71zPPaAZ4S8qtpx rcjA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sg20-20020a170907a41400b00782d7448ce5si4768378ejc.734.2022.09.28.01.48.30; Wed, 28 Sep 2022 01:48:45 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233621AbiI1Irz (ORCPT + 59 others); Wed, 28 Sep 2022 04:47:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233419AbiI1IrC (ORCPT ); Wed, 28 Sep 2022 04:47:02 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0FFEC1CB1C for ; Wed, 28 Sep 2022 01:44:40 -0700 (PDT) Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 28S8i8HJ1013406, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.81/5.90) with ESMTPS id 28S8i8HJ1013406 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=FAIL); Wed, 28 Sep 2022 16:44:08 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 28 Sep 2022 16:44:33 +0800 Received: from localhost (172.21.69.188) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Wed, 28 Sep 2022 16:44:32 +0800 From: Ping-Ke Shih To: CC: , Subject: [PATCH 5/9] wifi: rtw89: debug: txpwr_table considers sign Date: Wed, 28 Sep 2022 16:43:32 +0800 Message-ID: <20220928084336.34981-6-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220928084336.34981-1-pkshih@realtek.com> References: <20220928084336.34981-1-pkshih@realtek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [172.21.69.188] X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-KSE-ServerInfo: RTEXMBS04.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: trusted connection X-KSE-Antiphishing-Info: Clean X-KSE-Antiphishing-ScanningType: Deterministic X-KSE-Antiphishing-Method: None X-KSE-Antiphishing-Bases: 09/28/2022 08:30:00 X-KSE-AttachmentFiltering-Interceptor-Info: no applicable attachment filtering rules found X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: =?big5?B?Q2xlYW4sIGJhc2VzOiAyMDIyLzkvMjggpFekyCAwNzowMzowMA==?= X-KSE-BulkMessagesFiltering-Scan-Result: protection disabled X-KSE-ServerInfo: RTEXH36505.realtek.com.tw, 9 X-KSE-Attachment-Filter-Triggered-Rules: Clean X-KSE-Attachment-Filter-Triggered-Filters: Clean X-KSE-BulkMessagesFiltering-Scan-Result: protection disabled X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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 From: Zong-Zhe Yang Previously, value of each field is just shown as unsigned. Now, we start to show them with sign to make things more intuitive during debugging. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/debug.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw89/debug.c b/drivers/net/wireless/realtek/rtw89/debug.c index 730e83d54257f..f584fa57c82fa 100644 --- a/drivers/net/wireless/realtek/rtw89/debug.c +++ b/drivers/net/wireless/realtek/rtw89/debug.c @@ -464,7 +464,7 @@ static const struct txpwr_map __txpwr_map_lmt_ru = { }; static u8 __print_txpwr_ent(struct seq_file *m, const struct txpwr_ent *ent, - const u8 *buf, const u8 cur) + const s8 *buf, const u8 cur) { char *fmt; @@ -493,8 +493,9 @@ static int __print_txpwr_map(struct seq_file *m, struct rtw89_dev *rtwdev, const struct txpwr_map *map) { u8 fct = rtwdev->chip->txpwr_factor_mac; - u8 *buf, cur, i; u32 val, addr; + s8 *buf, tmp; + u8 cur, i; int ret; buf = vzalloc(map->addr_to - map->addr_from + 4); @@ -507,8 +508,11 @@ static int __print_txpwr_map(struct seq_file *m, struct rtw89_dev *rtwdev, val = MASKDWORD; cur = addr - map->addr_from; - for (i = 0; i < 4; i++, val >>= 8) - buf[cur + i] = FIELD_GET(MASKBYTE0, val) >> fct; + for (i = 0; i < 4; i++, val >>= 8) { + /* signed 7 bits, and reserved BIT(7) */ + tmp = sign_extend32(val, 6); + buf[cur + i] = tmp >> fct; + } } for (cur = 0, i = 0; i < map->size; i++) -- 2.25.1