2014-09-01 08:55:57

by Matteo Croce

[permalink] [raw]
Subject: [PATCH] mac80211: Format connected time

Format connected_time in the form hh:mm:ss

Signed-off-by: Matteo Croce <[email protected]>

--- a/net/mac80211/debugfs_sta.c
+++ b/net/mac80211/debugfs_sta.c
@@ -130,7 +130,7 @@ static ssize_t sta_connected_time_read(struct file
*file, char __user *userbuf,
result.tm_year -= 70;
result.tm_mday -= 1;
res = scnprintf(buf, sizeof(buf),
- "years - %ld\nmonths - %d\ndays - %d\nclock - %d:%d:%d\n\n",
+ "years - %ld\nmonths - %d\ndays - %d\nclock - %02d:%02d:%02d\n\n",
result.tm_year, result.tm_mon, result.tm_mday,
result.tm_hour, result.tm_min, result.tm_sec);
return simple_read_from_buffer(userbuf, count, ppos, buf, res);


2014-09-03 11:42:22

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211: Format connected time

This seems like a good enough change, but the subject is misleading - it
was formatted before, just not in a nice way :)

Also, your patch doesn't apply (otherwise I would've fixed it up myself)

johannes



2014-09-03 13:34:14

by Matteo Croce

[permalink] [raw]
Subject: Re: [PATCH] mac80211: Format connected time

Sorry, gmail wrapped the line with the C function.
Here is a fixed patch

Format connected_time in the form hh:mm:ss

Signed-off-by: Matteo Croce <[email protected]>

--- a/net/mac80211/debugfs_sta.c
+++ b/net/mac80211/debugfs_sta.c
@@ -130,7 +130,7 @@
result.tm_year -= 70;
result.tm_mday -= 1;
res = scnprintf(buf, sizeof(buf),
- "years - %ld\nmonths - %d\ndays - %d\nclock - %d:%d:%d\n\n",
+ "years - %ld\nmonths - %d\ndays - %d\nclock - %02d:%02d:%02d\n\n",
result.tm_year, result.tm_mon, result.tm_mday,
result.tm_hour, result.tm_min, result.tm_sec);
return simple_read_from_buffer(userbuf, count, ppos, buf, res);

2014-09-03 17:57:13

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211: Format connected time

On Wed, 2014-09-03 at 15:33 +0200, Matteo Croce wrote:
> Sorry, gmail wrapped the line with the C function.
> Here is a fixed patch

Nope, didn't work either :)

I think I'll just commit the fix myself ...

johannes