* [PATCH] irda: Fix likely typo in output format string
@ 2016-08-27 3:14 Oleg Drokin
2016-08-27 3:23 ` Joe Perches
2016-08-31 21:31 ` David Miller
0 siblings, 2 replies; 5+ messages in thread
From: Oleg Drokin @ 2016-08-27 3:14 UTC (permalink / raw)
To: Samuel Ortiz; +Cc: netdev, linux-kernel, Oleg Drokin
%ul would print an unsigned with a letter l at the end which does
not seem to be desired here, on the other hand the value being printed
is u32 so just drop the l instead of converting to %lu
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
drivers/net/irda/vlsi_ir.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c
index a0849f4..98308bd 100644
--- a/drivers/net/irda/vlsi_ir.c
+++ b/drivers/net/irda/vlsi_ir.c
@@ -279,7 +279,7 @@ static void vlsi_proc_ndev(struct seq_file *seq, struct net_device *ndev)
(idev->mode==IFF_SIR)?"SIR":((idev->mode==IFF_MIR)?"MIR":"FIR"));
sec = div_s64_rem(ktime_us_delta(ktime_get(), idev->last_rx),
USEC_PER_SEC, &usec);
- seq_printf(seq, "last rx: %ul.%06u sec\n", sec, usec);
+ seq_printf(seq, "last rx: %u.%06u sec\n", sec, usec);
seq_printf(seq, "RX: packets=%lu / bytes=%lu / errors=%lu / dropped=%lu",
ndev->stats.rx_packets, ndev->stats.rx_bytes, ndev->stats.rx_errors,
--
2.7.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] irda: Fix likely typo in output format string
2016-08-27 3:14 [PATCH] irda: Fix likely typo in output format string Oleg Drokin
@ 2016-08-27 3:23 ` Joe Perches
2016-08-31 21:31 ` David Miller
1 sibling, 0 replies; 5+ messages in thread
From: Joe Perches @ 2016-08-27 3:23 UTC (permalink / raw)
To: Oleg Drokin, Samuel Ortiz, Chunyan Zhang; +Cc: netdev, linux-kernel
(added Chunyan Zhang to cc)
On Fri, 2016-08-26 at 23:14 -0400, Oleg Drokin wrote:
> %ul would print an unsigned with a letter l at the end which does
> not seem to be desired here, on the other hand the value being printed
> is u32 so just drop the l instead of converting to %lu
Fixes: 497ec1f2a086 ("irda: vlsi_ir: Replace timeval with ktime_t")
Thanks Oleg
> diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c
[]
> @@ -279,7 +279,7 @@ static void vlsi_proc_ndev(struct seq_file *seq, struct net_device *ndev)
> (idev->mode==IFF_SIR)?"SIR":((idev->mode==IFF_MIR)?"MIR":"FIR"));
> sec = div_s64_rem(ktime_us_delta(ktime_get(), idev->last_rx),
> USEC_PER_SEC, &usec);
> - seq_printf(seq, "last rx: %ul.%06u sec\n", sec, usec);
> + seq_printf(seq, "last rx: %u.%06u sec\n", sec, usec);
>
> seq_printf(seq, "RX: packets=%lu / bytes=%lu / errors=%lu / dropped=%lu",
> ndev->stats.rx_packets, ndev->stats.rx_bytes, ndev->stats.rx_errors,
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] irda: Fix likely typo in output format string
2016-08-27 3:14 [PATCH] irda: Fix likely typo in output format string Oleg Drokin
2016-08-27 3:23 ` Joe Perches
@ 2016-08-31 21:31 ` David Miller
2016-08-31 21:36 ` Oleg Drokin
1 sibling, 1 reply; 5+ messages in thread
From: David Miller @ 2016-08-31 21:31 UTC (permalink / raw)
To: green; +Cc: samuel, netdev, linux-kernel
From: Oleg Drokin <green@linuxhacker.ru>
Date: Fri, 26 Aug 2016 23:14:06 -0400
> %ul would print an unsigned with a letter l at the end which does
> not seem to be desired here, on the other hand the value being printed
> is u32 so just drop the l instead of converting to %lu
>
> Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
%u is for unsigned values, and these are "s32" thus signed.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] irda: Fix likely typo in output format string
2016-08-31 21:31 ` David Miller
@ 2016-08-31 21:36 ` Oleg Drokin
2016-08-31 21:52 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Oleg Drokin @ 2016-08-31 21:36 UTC (permalink / raw)
To: David Miller; +Cc: samuel, netdev, linux-kernel
On Aug 31, 2016, at 5:31 PM, David Miller wrote:
> From: Oleg Drokin <green@linuxhacker.ru>
> Date: Fri, 26 Aug 2016 23:14:06 -0400
>
>> %ul would print an unsigned with a letter l at the end which does
>> not seem to be desired here, on the other hand the value being printed
>> is u32 so just drop the l instead of converting to %lu
>>
>> Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
>
> %u is for unsigned values, and these are "s32" thus signed.
Hm, you are right.
I could swear I saw them as unsigned when I looked at it.
Anyway can they really be negative? they are seconds and usec,
should I change them to u32 too?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] irda: Fix likely typo in output format string
2016-08-31 21:36 ` Oleg Drokin
@ 2016-08-31 21:52 ` David Miller
0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2016-08-31 21:52 UTC (permalink / raw)
To: green; +Cc: samuel, netdev, linux-kernel
From: Oleg Drokin <green@linuxhacker.ru>
Date: Wed, 31 Aug 2016 17:36:44 -0400
>
> On Aug 31, 2016, at 5:31 PM, David Miller wrote:
>
>> From: Oleg Drokin <green@linuxhacker.ru>
>> Date: Fri, 26 Aug 2016 23:14:06 -0400
>>
>>> %ul would print an unsigned with a letter l at the end which does
>>> not seem to be desired here, on the other hand the value being printed
>>> is u32 so just drop the l instead of converting to %lu
>>>
>>> Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
>>
>> %u is for unsigned values, and these are "s32" thus signed.
>
> Hm, you are right.
> I could swear I saw them as unsigned when I looked at it.
>
> Anyway can they really be negative? they are seconds and usec,
> should I change them to u32 too?
If you're interesting in continuing with this, it is your
area for exploration not our's :-)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-08-31 21:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-27 3:14 [PATCH] irda: Fix likely typo in output format string Oleg Drokin
2016-08-27 3:23 ` Joe Perches
2016-08-31 21:31 ` David Miller
2016-08-31 21:36 ` Oleg Drokin
2016-08-31 21:52 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).