irda: Fix likely typo in output format string
Subsystems (2)
PATCH 1/1 irda: Fix likely typo in output format string
%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
--- drivers/net/irda/vlsi_ir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/irda/vlsi_ir.c +1 -1
@@ -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,
Signature · 1 line
2.7.4
(added Chunyan Zhang to cc)
Quoted 3 lines · 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
Thanks Oleg
drivers/net/irda/vlsi_ir.c
Quoted 1 line
drivers/net/irda/vlsi_ir.c +0
-0
[]
Quoted 9 lines
drivers/net/irda/vlsi_ir.c +1
-1@@ -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,
David Miller
maintainerFrom: Oleg Drokin <[email protected]>
Date: Fri, 26 Aug 2016 23:14:06 -0400
Quoted 5 lines
%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 <[email protected]>
%u is for unsigned values, and these are "s32" thus signed.
Quoted 10 lines · David Miller
From: Oleg Drokin <[email protected]>
Date: Fri, 26 Aug 2016 23:14:06 -0400Quoted 5 lines
%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 <[email protected]>%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?
David Miller
maintainerFrom: Oleg Drokin <[email protected]>
Date: Wed, 31 Aug 2016 17:36:44 -0400
Quoted 12 lines · David Miller
Quoted 10 lines
From: Oleg Drokin <[email protected]>
Date: Fri, 26 Aug 2016 23:14:06 -0400Quoted 5 lines
%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 <[email protected]>
Quoted 7 lines
Quoted 1 line
%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 :-)