From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933682AbbI1NAh (ORCPT ); Mon, 28 Sep 2015 09:00:37 -0400 Received: from Chamillionaire.breakpoint.cc ([80.244.247.6]:36931 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933393AbbI1NAg (ORCPT ); Mon, 28 Sep 2015 09:00:36 -0400 Date: Mon, 28 Sep 2015 15:00:31 +0200 From: Florian Westphal To: Alexander Stein Cc: "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] net sysfs: Print link speed as signed integer Message-ID: <20150928130031.GA19923@breakpoint.cc> References: <1443444529-12868-1-git-send-email-alexander.stein@systec-electronic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1443444529-12868-1-git-send-email-alexander.stein@systec-electronic.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Alexander Stein 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 > --- > 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.