Skip to contentSkip to conversation

x86: remove (null) in /sys kernel_page_tables

PATCH In review Yinghai Lu 1 participant 2 messages Apr 14, 2009

Subsystems (2)
lore
Share & tools
lore

Yinghai Lu

author
#0 lore raw

PATCH 1/1 x86: remove (null) in /sys kernel_page_tables

Impact: clearnup

%p prints out 0x000000000000000 as (null)
so use %lx instead.

---
 arch/x86/mm/dump_pagetables.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
arch/x86/mm/dump_pagetables.c +4 -3
Index: linux-2.6/arch/x86/mm/dump_pagetables.c
===================================================================
@@ -161,13 +161,14 @@ static void note_page(struct seq_file *m
 		   st->current_address >= st->marker[1].start_address) {
 		const char *unit = units;
 		unsigned long delta;
+		int width = sizeof(unsigned long) * 2;
 
 		/*
 		 * Now print the actual finished series
 		 */
-		seq_printf(m, "0x%p-0x%p   ",
-			   (void *)st->start_address,
-			   (void *)st->current_address);
+		seq_printf(m, "0x%0*lx-0x%0*lx   ",
+			   width, st->start_address,
+			   width, st->current_address);
 
 		delta = (st->current_address - st->start_address) >> 10;
 		while (!(delta & 1023) && unit[1]) {
#1 lore raw
Commit-ID:  6424fb38667fffbbb1b90be0ffd9a0c540db6a4b
Gitweb:     http://git.kernel.org/tip/6424fb38667fffbbb1b90be0ffd9a0c540db6a4b
Author:     Yinghai Lu <[email protected]>
AuthorDate: Mon, 13 Apr 2009 23:51:46 -0700
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 14 Apr 2009 11:50:22 +0200

x86: remove (null) in /sys kernel_page_tables

Impact: cleanup

%p prints out 0x000000000000000 as (null)
so use %lx instead.

LKML-Reference: <[email protected]>

---
 arch/x86/mm/dump_pagetables.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
arch/x86/mm/dump_pagetables.c +4 -3
index e7277cb..a725b7f 100644
@@ -161,13 +161,14 @@ static void note_page(struct seq_file *m, struct pg_state *st,
 		   st->current_address >= st->marker[1].start_address) {
 		const char *unit = units;
 		unsigned long delta;
+		int width = sizeof(unsigned long) * 2;
 
 		/*
 		 * Now print the actual finished series
 		 */
-		seq_printf(m, "0x%p-0x%p   ",
-			   (void *)st->start_address,
-			   (void *)st->current_address);
+		seq_printf(m, "0x%0*lx-0x%0*lx   ",
+			   width, st->start_address,
+			   width, st->current_address);
 
 		delta = (st->current_address - st->start_address) >> 10;
 		while (!(delta & 1023) && unit[1]) {