From patchwork Mon Apr 30 08:39:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Tjernlund X-Patchwork-Id: 155812 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 92B5CB6F13 for ; Mon, 30 Apr 2012 18:39:14 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754950Ab2D3IjM (ORCPT ); Mon, 30 Apr 2012 04:39:12 -0400 Received: from gw1.transmode.se ([195.58.98.146]:54660 "EHLO gw1.transmode.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753361Ab2D3IjL (ORCPT ); Mon, 30 Apr 2012 04:39:11 -0400 Received: from mail1.transmode.se (mail1.transmode.se [192.168.201.18]) by gw1.transmode.se (Postfix) with ESMTP id BE81A25803A for ; Mon, 30 Apr 2012 10:39:10 +0200 (CEST) Received: from gentoo-jocke.transmode.se ([172.20.4.10]) by mail1.transmode.se (Lotus Domino Release 8.5.3FP1) with ESMTP id 2012043010390978-134757 ; Mon, 30 Apr 2012 10:39:09 +0200 Received: from gentoo-jocke.transmode.se (localhost [127.0.0.1]) by gentoo-jocke.transmode.se (8.14.4/8.14.0) with ESMTP id q3U8dAZW005228; Mon, 30 Apr 2012 10:39:10 +0200 Received: (from jocke@localhost) by gentoo-jocke.transmode.se (8.14.4/8.14.4/Submit) id q3U8dAPO005227; Mon, 30 Apr 2012 10:39:10 +0200 From: Joakim Tjernlund To: "netdev@vger.kernel.org" Cc: Joakim Tjernlund Subject: [PATCH] bridge: make brctl showstp display port id Date: Mon, 30 Apr 2012 10:39:08 +0200 Message-Id: <1335775148-5191-1-git-send-email-Joakim.Tjernlund@transmode.se> X-Mailer: git-send-email 1.7.3.4 X-MIMETrack: Itemize by SMTP Server on mail1/Transmode(Release 8.5.3FP1|March 07, 2012) at 30/04/2012 10:39:09, Serialize by Router on mail1/Transmode(Release 8.5.3FP1|March 07, 2012) at 30/04/2012 10:39:09, Serialize complete at 30/04/2012 10:39:09 X-TNEFEvaluated: 1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org My brctl showstp br0 always shows a 0 port id: eth2 (1) port id 0 state disabled designated root 8000.00069c00b2fb path cost 100 because port id is printed as a hex number in sys fs. Change the two hex occurrences(port no and port id) to decimal, just like all the other numbers in this area. Signed-off-by: Joakim Tjernlund --- net/bridge/br_sysfs_if.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/bridge/br_sysfs_if.c b/net/bridge/br_sysfs_if.c index fd5799c..9c4c2eb 100644 --- a/net/bridge/br_sysfs_if.c +++ b/net/bridge/br_sysfs_if.c @@ -86,13 +86,13 @@ static BRPORT_ATTR(designated_cost, S_IRUGO, show_designated_cost, NULL); static ssize_t show_port_id(struct net_bridge_port *p, char *buf) { - return sprintf(buf, "0x%x\n", p->port_id); + return sprintf(buf, "%d\n", p->port_id); } static BRPORT_ATTR(port_id, S_IRUGO, show_port_id, NULL); static ssize_t show_port_no(struct net_bridge_port *p, char *buf) { - return sprintf(buf, "0x%x\n", p->port_no); + return sprintf(buf, "%d\n", p->port_no); } static BRPORT_ATTR(port_no, S_IRUGO, show_port_no, NULL);