From: Maya Erez <merez@codeaurora.org>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: Dedy Lansky <dlansky@codeaurora.org>,
linux-wireless@vger.kernel.org, wil6210@qti.qualcomm.com,
Maya Erez <merez@codeaurora.org>
Subject: [PATCH v2 04/19] wil6210: fix temperature debugfs
Date: Tue, 24 Jul 2018 10:44:25 +0300 [thread overview]
Message-ID: <1532418280-5849-5-git-send-email-merez@codeaurora.org> (raw)
In-Reply-To: <1532418280-5849-1-git-send-email-merez@codeaurora.org>
From: Dedy Lansky <dlansky@codeaurora.org>
For negative temperatures, "temp" debugfs is showing wrong values.
Use signed types so proper calculations is done for sub zero
temperatures.
Signed-off-by: Dedy Lansky <dlansky@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
---
drivers/net/wireless/ath/wil6210/debugfs.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c
index 5d1e48d..4356b32 100644
--- a/drivers/net/wireless/ath/wil6210/debugfs.c
+++ b/drivers/net/wireless/ath/wil6210/debugfs.c
@@ -1388,7 +1388,7 @@ static int wil_bf_seq_open(struct inode *inode, struct file *file)
};
/*---------temp------------*/
-static void print_temp(struct seq_file *s, const char *prefix, u32 t)
+static void print_temp(struct seq_file *s, const char *prefix, s32 t)
{
switch (t) {
case 0:
@@ -1396,7 +1396,8 @@ static void print_temp(struct seq_file *s, const char *prefix, u32 t)
seq_printf(s, "%s N/A\n", prefix);
break;
default:
- seq_printf(s, "%s %d.%03d\n", prefix, t / 1000, t % 1000);
+ seq_printf(s, "%s %s%d.%03d\n", prefix, (t < 0 ? "-" : ""),
+ abs(t / 1000), abs(t % 1000));
break;
}
}
@@ -1404,7 +1405,7 @@ static void print_temp(struct seq_file *s, const char *prefix, u32 t)
static int wil_temp_debugfs_show(struct seq_file *s, void *data)
{
struct wil6210_priv *wil = s->private;
- u32 t_m, t_r;
+ s32 t_m, t_r;
int rc = wmi_get_temperature(wil, &t_m, &t_r);
if (rc) {
--
1.9.1
next prev parent reply other threads:[~2018-07-24 8:49 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-24 7:44 [PATCH v2 00/19] wil6210 patches Maya Erez
2018-07-24 7:44 ` [PATCH v2 01/19] wil6210: Rx multicast packets duplicate detection Maya Erez
2018-07-31 8:05 ` Kalle Valo
2018-07-24 7:44 ` [PATCH v2 02/19] wil6210: drop Rx packets with L2 error indication from HW Maya Erez
2018-07-24 7:44 ` [PATCH v2 03/19] wil6210: add TX latency statistics Maya Erez
2018-07-24 7:44 ` Maya Erez [this message]
2018-07-24 7:44 ` [PATCH v2 05/19] wil6210: fix RX checksum report to network stack Maya Erez
2018-07-24 7:44 ` [PATCH v2 06/19] wil6210: support Talyn specific FW file Maya Erez
2018-07-24 7:44 ` [PATCH v2 07/19] wil6210: align to latest auto generated wmi.h Maya Erez
2018-07-24 7:44 ` [PATCH v2 08/19] wil6210: add 3-MSI support Maya Erez
2018-07-24 7:44 ` [PATCH v2 09/19] wil6210: fix min() compilation errors Maya Erez
2018-07-24 7:44 ` [PATCH v2 10/19] wil6210: add support for link statistics Maya Erez
2018-07-24 7:44 ` [PATCH v2 11/19] wil6210: allow scan on AP interface Maya Erez
2018-07-24 7:44 ` [PATCH v2 12/19] wil6210: support max aggregation window size 64 Maya Erez
2018-07-24 7:44 ` [PATCH v2 13/19] wil6210: increase firmware ready timeout Maya Erez
2018-07-24 7:44 ` [PATCH v2 14/19] wil6210: support Talyn specific board file Maya Erez
2018-07-24 7:44 ` [PATCH v2 15/19] wil6210: set default 3-MSI Maya Erez
2018-07-24 7:44 ` [PATCH v2 16/19] wil6210: align to latest auto generated wmi.h Maya Erez
2018-07-24 7:44 ` [PATCH v2 17/19] wil6210: off channel transmit management frames in AP mode Maya Erez
2018-07-24 7:44 ` [PATCH v2 18/19] wil6210: prevent FW download if HW is configured for secured boot Maya Erez
2018-07-24 7:44 ` [PATCH v2 19/19] wil6210: fix eDMA RX chaining Maya Erez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1532418280-5849-5-git-send-email-merez@codeaurora.org \
--to=merez@codeaurora.org \
--cc=dlansky@codeaurora.org \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=wil6210@qti.qualcomm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.