lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1452810221-116505-11-git-send-email-andriy.shevchenko@linux.intel.com>
Date:	Fri, 15 Jan 2016 00:23:40 +0200
From:	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:	Robert Elliott <elliott@....com>,
	Matt Fleming <matt@...eblueprint.co.uk>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>, linux-kernel@...r.kernel.org,
	Rasmus Villemoes <linux@...musvillemoes.dk>,
	Brian Norris <computersforpeace@...il.com>,
	Hariprasad S <hariprasad@...lsio.com>
Cc:	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: [PATCH v2 10/11] cxgb4: print value in human-readable form via %.0plKM

Recently added %pl[From[To]] specifier is dedicated to print values in
human-readable format with IEC prefix. Convert the code to use it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c
index e6a4072..5185d8e 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c
@@ -2820,6 +2820,7 @@ static int meminfo_show(struct seq_file *seq, void *v)
 	};
 
 	int i, n;
+	u64 size;
 	u32 lo, hi, used, alloc;
 	struct mem_desc avail[4];
 	struct mem_desc mem[ARRAY_SIZE(region) + 3];      /* up to 3 holes */
@@ -2936,10 +2937,10 @@ static int meminfo_show(struct seq_file *seq, void *v)
 	md->base = 0;
 	md->idx = ARRAY_SIZE(region);
 	if (!is_t4(adap->params.chip)) {
-		u32 size = 0;
 		u32 sge_ctrl = t4_read_reg(adap, SGE_CONTROL2_A);
 		u32 fifo_size = t4_read_reg(adap, SGE_DBVFIFO_SIZE_A);
 
+		size = 0;
 		if (is_t5(adap->params.chip)) {
 			if (sge_ctrl & VFIFO_ENABLE_F)
 				size = DBVFIFO_SIZE_G(fifo_size);
@@ -3010,11 +3011,9 @@ static int meminfo_show(struct seq_file *seq, void *v)
 		   (lo & PMRXNUMCHN_F) ? 2 : 1);
 
 	lo = t4_read_reg(adap, TP_PMM_TX_MAX_PAGE_A);
-	hi = t4_read_reg(adap, TP_PMM_TX_PAGE_SIZE_A);
-	seq_printf(seq, "%u Tx pages of size %u%ciB for %u channels\n",
-		   PMTXMAXPAGE_G(lo),
-		   hi >= (1 << 20) ? (hi >> 20) : (hi >> 10),
-		   hi >= (1 << 20) ? 'M' : 'K', 1 << PMTXNUMCHN_G(lo));
+	size = t4_read_reg(adap, TP_PMM_TX_PAGE_SIZE_A);
+	seq_printf(seq, "%u Tx pages of size %.0plKM for %u channels\n",
+		   PMTXMAXPAGE_G(lo), &size, 1 << PMTXNUMCHN_G(lo));
 	seq_printf(seq, "%u p-structs\n\n",
 		   t4_read_reg(adap, TP_CMM_MM_MAX_PSTRUCT_A));
 
-- 
2.6.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ