Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1234101 > unrolled thread

[PATCH 1/1] net sysfs: Print link speed as signed integer

Started byAlexander Stein <alexander.stein@systec-electronic.com>
First post2015-09-28 14:50 +0200
Last post2015-09-28 15:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/1] net sysfs: Print link speed as signed integer Alexander Stein <alexander.stein@systec-electronic.com> - 2015-09-28 14:50 +0200
    Re: [PATCH 1/1] net sysfs: Print link speed as signed integer Florian Westphal <fw@strlen.de> - 2015-09-28 15:10 +0200

#1234101 — [PATCH 1/1] net sysfs: Print link speed as signed integer

FromAlexander Stein <alexander.stein@systec-electronic.com>
Date2015-09-28 14:50 +0200
Subject[PATCH 1/1] net sysfs: Print link speed as signed integer
Message-ID<qdG2u-5Zh-1@gated-at.bofh.it>
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1234134

FromFlorian Westphal <fw@strlen.de>
Date2015-09-28 15:10 +0200
Message-ID<qdGlR-6Bl-45@gated-at.bofh.it>
In reply to#1234101
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web