public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] net sysfs: Print link speed as signed integer
@ 2015-09-28 12:48 Alexander Stein
  2015-09-28 13:00 ` Florian Westphal
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Stein @ 2015-09-28 12:48 UTC (permalink / raw)
  To: David S. Miller; +Cc: Alexander Stein, netdev, linux-kernel

Otherwise 4294967295 (MBit/s) (-1) will be printed when there is no link.
Documentation/ABI/testing/sysfs-class-net does not state if this shall be
signed or unsigned.

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
---
 net/core/net-sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 805a95a..e3f7eea 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -31,7 +31,7 @@
 static const char fmt_hex[] = "%#x\n";
 static const char fmt_long_hex[] = "%#lx\n";
 static const char fmt_dec[] = "%d\n";
-static const char fmt_udec[] = "%u\n";
+static const char fmt_udec[] = "%d\n";
 static const char fmt_ulong[] = "%lu\n";
 static const char fmt_u64[] = "%llu\n";
 
-- 
2.4.9


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] net sysfs: Print link speed as signed integer
  2015-09-28 12:48 [PATCH 1/1] net sysfs: Print link speed as signed integer Alexander Stein
@ 2015-09-28 13:00 ` Florian Westphal
  0 siblings, 0 replies; 2+ messages in thread
From: Florian Westphal @ 2015-09-28 13:00 UTC (permalink / raw)
  To: Alexander Stein; +Cc: David S. Miller, netdev, linux-kernel

Alexander Stein <alexander.stein@systec-electronic.com> wrote:
> Otherwise 4294967295 (MBit/s) (-1) will be printed when there is no link.
> Documentation/ABI/testing/sysfs-class-net does not state if this shall be
> signed or unsigned.
> 
> Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
> ---
> diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
> index 805a95a..e3f7eea 100644
> --- a/net/core/net-sysfs.c
> +++ b/net/core/net-sysfs.c
> @@ -31,7 +31,7 @@
>  static const char fmt_hex[] = "%#x\n";
>  static const char fmt_long_hex[] = "%#lx\n";
>  static const char fmt_dec[] = "%d\n";
> -static const char fmt_udec[] = "%u\n";
> +static const char fmt_udec[] = "%d\n";
>  static const char fmt_ulong[] = "%lu\n";
>  static const char fmt_u64[] = "%llu\n";

That looks bogus.  If this is about 'speed' attribute
consider removing fmt_udec and replace the printf specifier
of speed_show with fmt_dec instead.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-28 13:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-28 12:48 [PATCH 1/1] net sysfs: Print link speed as signed integer Alexander Stein
2015-09-28 13:00 ` Florian Westphal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox